├── .point-changed-filelist ├── ChangeLog ├── CommitLog-4.1.0 ├── INSTALL ├── Makefile.am ├── NEWS ├── NOTES.y2kfixes ├── README ├── README.bk ├── README.hackers ├── README.leapsmear ├── README.patches ├── README.refclocks ├── README.simulator ├── README.versions ├── TODO ├── WHERE-TO-START ├── adjtimed ├── Makefile.am ├── README └── adjtimed.c ├── bincheck.mf ├── bootstrap ├── br-flock ├── build ├── check-libopts.mf ├── clockstuff ├── Makefile.am ├── README ├── chutest.c └── propdelay.c ├── conf ├── README ├── baldwin.conf ├── beauregard.conf ├── grundoon.conf ├── malarky.conf ├── pogo.conf └── rackety.conf ├── configure.ac ├── deps-ver ├── depsver.mf ├── dot.emacs ├── flock-build ├── html ├── access.html ├── accopt.html ├── assoc.html ├── audio.html ├── authentic.html ├── authopt.html ├── autokey.html ├── bugs.html ├── build.html ├── clock.html ├── clockopt.html ├── cluster.html ├── comdex.html ├── config.html ├── confopt.html ├── copyright.html ├── debug.html ├── decode.html ├── discipline.html ├── discover.html ├── drivers │ ├── driver1.html │ ├── driver10.html │ ├── driver11.html │ ├── driver12.html │ ├── driver16.html │ ├── driver18.html │ ├── driver19.html │ ├── driver20.html │ ├── driver22.html │ ├── driver26.html │ ├── driver27.html │ ├── driver28.html │ ├── driver29.html │ ├── driver3.html │ ├── driver30.html │ ├── driver31.html │ ├── driver32.html │ ├── driver33.html │ ├── driver34.html │ ├── driver35.html │ ├── driver36.html │ ├── driver37.html │ ├── driver38.html │ ├── driver39.html │ ├── driver4.html │ ├── driver40-ja.html │ ├── driver40.html │ ├── driver42.html │ ├── driver43.html │ ├── driver44.html │ ├── driver45.html │ ├── driver46.html │ ├── driver5.html │ ├── driver6.html │ ├── driver7.html │ ├── driver8.html │ ├── driver9.html │ ├── icons │ │ ├── home.gif │ │ └── mail2.gif │ ├── mx4200data.html │ ├── oncore-shmem.html │ ├── scripts │ │ ├── footer.txt │ │ └── style.css │ └── tf582_4.html ├── extern.html ├── filter.html ├── hints.html ├── hints │ ├── a-ux │ ├── aix │ ├── bsdi │ ├── changes │ ├── decosf1 │ ├── decosf2 │ ├── freebsd │ ├── hpux │ ├── linux │ ├── mpeix │ ├── notes-xntp-v3 │ ├── parse │ ├── refclocks │ ├── rs6000 │ ├── sco.html │ ├── sgi │ ├── solaris-dosynctodr.html │ ├── solaris.html │ ├── solaris.xtra.4023118 │ ├── solaris.xtra.4095849 │ ├── solaris.xtra.S99ntpd │ ├── solaris.xtra.patchfreq │ ├── sun4 │ ├── svr4-dell │ ├── svr4_package │ ├── todo │ ├── vxworks.html │ └── winnt.html ├── history.html ├── howto.html ├── huffpuff.html ├── icons │ ├── home.gif │ ├── mail2.gif │ └── sitemap.png ├── index.html ├── kern.html ├── kernpps.html ├── keygen.html ├── leap.html ├── miscopt.html ├── monopt.html ├── msyslog.html ├── ntp-wait.html ├── ntp_conf.html ├── ntpd.html ├── ntpdate.html ├── ntpdc.html ├── ntpdsim.html ├── ntpdsim_new.html ├── ntpq.html ├── ntptime.html ├── ntptrace.html ├── orphan.html ├── parsedata.html ├── parsenew.html ├── pic │ ├── 9400n.jpg │ ├── alice11.gif │ ├── alice13.gif │ ├── alice15.gif │ ├── alice23.gif │ ├── alice31.gif │ ├── alice32.gif │ ├── alice35.gif │ ├── alice38.gif │ ├── alice44.gif │ ├── alice47.gif │ ├── alice51.gif │ ├── alice61.gif │ ├── barnstable.gif │ ├── beaver.gif │ ├── boom3.gif │ ├── boom3a.gif │ ├── boom4.gif │ ├── broad.gif │ ├── bustardfly.gif │ ├── c51.jpg │ ├── description.jpg │ ├── discipline.gif │ ├── dogsnake.gif │ ├── driver29.gif │ ├── driver43_1.gif │ ├── driver43_2.jpg │ ├── fg6021.gif │ ├── fg6039.jpg │ ├── fig_3_1.gif │ ├── flatheads.gif │ ├── flt1.gif │ ├── flt2.gif │ ├── flt3.gif │ ├── flt4.gif │ ├── flt5.gif │ ├── flt6.gif │ ├── flt7.gif │ ├── flt8.gif │ ├── flt9.gif │ ├── freq1211.gif │ ├── gadget.jpg │ ├── gps167.jpg │ ├── group.gif │ ├── hornraba.gif │ ├── igclock.gif │ ├── neoclock4x.gif │ ├── offset1211.gif │ ├── oncore_evalbig.gif │ ├── oncore_remoteant.jpg │ ├── oncore_utplusbig.gif │ ├── oz2.gif │ ├── panda.gif │ ├── pd_om006.gif │ ├── pd_om011.gif │ ├── peer.gif │ ├── pogo.gif │ ├── pogo1a.gif │ ├── pogo3a.gif │ ├── pogo4.gif │ ├── pogo5.gif │ ├── pogo6.gif │ ├── pogo7.gif │ ├── pogo8.gif │ ├── pzf509.jpg │ ├── pzf511.jpg │ ├── rabbit.gif │ ├── radio2.jpg │ ├── sheepb.jpg │ ├── stack1a.jpg │ ├── stats.gif │ ├── sx5.gif │ ├── thunderbolt.jpg │ ├── time1.gif │ ├── tonea.gif │ ├── tribeb.gif │ └── wingdorothy.gif ├── poll.html ├── pps.html ├── prefer.html ├── quick.html ├── rate.html ├── rdebug.html ├── refclock.html ├── release.html ├── scripts │ ├── accopt.txt │ ├── audio.txt │ ├── authopt.txt │ ├── clockopt.txt │ ├── command.txt │ ├── config.txt │ ├── confopt.txt │ ├── external.txt │ ├── footer.txt │ ├── hand.txt │ ├── install.txt │ ├── manual.txt │ ├── misc.txt │ ├── miscopt.txt │ ├── monopt.txt │ ├── refclock.txt │ ├── special.txt │ └── style.css ├── select.html ├── sitemap.html ├── sntp.html ├── stats.html ├── tickadj.html ├── warp.html └── xleave.html ├── include ├── Makefile.am ├── README ├── adjtime.h ├── ascii.h ├── audio.h ├── binio.h ├── declcond.h ├── gps.h ├── hopf6039.h ├── icom.h ├── ieee754io.h ├── interfaceiter.h ├── intreswork.h ├── iosignal.h ├── isc │ ├── Makefile.am │ └── mem.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_datum.h ├── ntp_debug.h ├── ntp_filegen.h ├── ntp_fp.h ├── ntp_if.h ├── ntp_intres.h ├── ntp_io.h ├── ntp_keyacc.h ├── ntp_libopts.h ├── ntp_lineedit.h ├── ntp_lists.h ├── ntp_machine.h ├── ntp_malloc.h ├── ntp_md5.h ├── ntp_net.h ├── ntp_prio_q.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 ├── rc_cmdlength.h ├── recvbuff.h ├── refclock_atom.h ├── refidsmear.h ├── safecast.h ├── ssl_applink.c ├── timepps-SCO.h ├── timepps-Solaris.h ├── timepps-SunOS.h ├── timespecops.h ├── timetoa.h ├── timevalops.h ├── trimble.h └── vint64ops.h ├── includes.mf ├── kernel ├── Makefile.am └── sys │ ├── Makefile.am │ ├── README │ ├── bsd_audioirig.h │ ├── i8253.h │ ├── parsestreams.h │ ├── pcl720.h │ ├── ppsclock.h │ ├── timex.h │ ├── tpro.h │ └── tt560_api.h ├── lib └── isc │ ├── Atffile │ ├── alpha │ └── include │ │ └── isc │ │ └── atomic.h │ ├── api │ ├── app_api.c │ ├── assertions.c │ ├── backtrace-emptytbl.c │ ├── backtrace.c │ ├── base32.c │ ├── base64.c │ ├── bitstring.c │ ├── buffer.c │ ├── bufferlist.c │ ├── commandline.c │ ├── entropy.c │ ├── error.c │ ├── event.c │ ├── fsaccess.c │ ├── hash.c │ ├── heap.c │ ├── hex.c │ ├── hmacmd5.c │ ├── hmacsha.c │ ├── httpd.c │ ├── ia64 │ └── include │ │ └── isc │ │ └── atomic.h │ ├── include │ └── isc │ │ ├── app.h │ │ ├── assertions.h │ │ ├── backtrace.h │ │ ├── base32.h │ │ ├── base64.h │ │ ├── bind9.h │ │ ├── bitstring.h │ │ ├── boolean.h │ │ ├── buffer.h │ │ ├── bufferlist.h │ │ ├── commandline.h │ │ ├── entropy.h │ │ ├── error.h │ │ ├── event.h │ │ ├── eventclass.h │ │ ├── file.h │ │ ├── formatcheck.h │ │ ├── fsaccess.h │ │ ├── hash.h │ │ ├── heap.h │ │ ├── hex.h │ │ ├── hmacmd5.h │ │ ├── hmacsha.h │ │ ├── httpd.h │ │ ├── interfaceiter.h │ │ ├── ipv6.h │ │ ├── iterated_hash.h │ │ ├── lang.h │ │ ├── lex.h │ │ ├── lfsr.h │ │ ├── lib.h │ │ ├── list.h │ │ ├── log.h │ │ ├── magic.h │ │ ├── md5.h │ │ ├── mem.h │ │ ├── msgcat.h │ │ ├── msgs.h │ │ ├── mutexblock.h │ │ ├── namespace.h │ │ ├── netaddr.h │ │ ├── netscope.h │ │ ├── ondestroy.h │ │ ├── os.h │ │ ├── parseint.h │ │ ├── platform.h │ │ ├── platform.h.in │ │ ├── portset.h │ │ ├── print.h │ │ ├── queue.h │ │ ├── quota.h │ │ ├── radix.h │ │ ├── random.h │ │ ├── ratelimiter.h │ │ ├── refcount.h │ │ ├── region.h │ │ ├── resource.h │ │ ├── result.h │ │ ├── resultclass.h │ │ ├── rwlock.h │ │ ├── serial.h │ │ ├── sha1.h │ │ ├── sha2.h │ │ ├── sockaddr.h │ │ ├── socket.h │ │ ├── stats.h │ │ ├── stdio.h │ │ ├── stdlib.h │ │ ├── string.h │ │ ├── symtab.h │ │ ├── task.h │ │ ├── taskpool.h │ │ ├── timer.h │ │ ├── types.h │ │ ├── util.h │ │ ├── version.h │ │ └── xml.h │ ├── inet_aton.c │ ├── inet_ntop.c │ ├── inet_pton.c │ ├── iterated_hash.c │ ├── lex.c │ ├── lfsr.c │ ├── lib.c │ ├── log.c │ ├── md5.c │ ├── mem.c │ ├── mem_api.c │ ├── mips │ └── include │ │ └── isc │ │ └── atomic.h │ ├── mutexblock.c │ ├── netaddr.c │ ├── netscope.c │ ├── nls │ └── msgcat.c │ ├── noatomic │ └── include │ │ └── isc │ │ └── atomic.h │ ├── nothreads │ ├── condition.c │ ├── include │ │ └── isc │ │ │ ├── condition.h │ │ │ ├── mutex.h │ │ │ ├── once.h │ │ │ └── thread.h │ ├── mutex.c │ └── thread.c │ ├── ondestroy.c │ ├── parseint.c │ ├── portset.c │ ├── powerpc │ └── include │ │ └── isc │ │ └── atomic.h │ ├── print.c │ ├── pthreads │ ├── condition.c │ ├── include │ │ └── isc │ │ │ ├── condition.h │ │ │ ├── mutex.h │ │ │ ├── once.h │ │ │ └── thread.h │ ├── mutex.c │ └── thread.c │ ├── quota.c │ ├── radix.c │ ├── random.c │ ├── ratelimiter.c │ ├── refcount.c │ ├── region.c │ ├── result.c │ ├── rwlock.c │ ├── serial.c │ ├── sha1.c │ ├── sha2.c │ ├── sockaddr.c │ ├── socket_api.c │ ├── sparc64 │ └── include │ │ └── isc │ │ └── atomic.h │ ├── stats.c │ ├── string.c │ ├── strtoul.c │ ├── symtab.c │ ├── task.c │ ├── task_api.c │ ├── task_p.h │ ├── taskpool.c │ ├── tests │ ├── Atffile │ ├── hash_test.c │ ├── isctest.c │ ├── isctest.h │ ├── queue_test.c │ ├── socket_test.c │ ├── symtab_test.c │ ├── task_test.c │ └── taskpool_test.c │ ├── timer.c │ ├── timer_api.c │ ├── timer_p.h │ ├── unix │ ├── app.c │ ├── dir.c │ ├── entropy.c │ ├── errno2result.c │ ├── errno2result.h │ ├── file.c │ ├── fsaccess.c │ ├── ifiter_getifaddrs.c │ ├── ifiter_ioctl.c │ ├── ifiter_sysctl.c │ ├── include │ │ └── isc │ │ │ ├── dir.h │ │ │ ├── int.h │ │ │ ├── keyboard.h │ │ │ ├── net.h │ │ │ ├── netdb.h │ │ │ ├── offset.h │ │ │ ├── stat.h │ │ │ ├── stdtime.h │ │ │ ├── strerror.h │ │ │ ├── syslog.h │ │ │ └── time.h │ ├── interfaceiter.c │ ├── ipv6.c │ ├── keyboard.c │ ├── net.c │ ├── os.c │ ├── resource.c │ ├── socket.c │ ├── socket_p.h │ ├── stdio.c │ ├── stdtime.c │ ├── strerror.c │ ├── syslog.c │ └── time.c │ ├── version.c │ ├── win32 │ ├── DLLMain.c │ ├── app.c │ ├── condition.c │ ├── dir.c │ ├── entropy.c │ ├── errno2result.c │ ├── errno2result.h │ ├── file.c │ ├── fsaccess.c │ ├── include │ │ └── isc │ │ │ ├── bind_registry.h │ │ │ ├── bindevt.h │ │ │ ├── condition.h │ │ │ ├── dir.h │ │ │ ├── int.h │ │ │ ├── ipv6.h │ │ │ ├── keyboard.h │ │ │ ├── mutex.h │ │ │ ├── net.h │ │ │ ├── netdb.h │ │ │ ├── ntgroups.h │ │ │ ├── ntpaths.h │ │ │ ├── offset.h │ │ │ ├── once.h │ │ │ ├── platform.h │ │ │ ├── stat.h │ │ │ ├── stdtime.h │ │ │ ├── strerror.h │ │ │ ├── syslog.h │ │ │ ├── thread.h │ │ │ ├── time.h │ │ │ └── win32os.h │ ├── interfaceiter.c │ ├── ipv6.c │ ├── keyboard.c │ ├── libgen.h │ ├── libisc.def │ ├── libisc.dsp │ ├── libisc.dsw │ ├── libisc.mak │ ├── net.c │ ├── netdb.h │ ├── ntgroups.c │ ├── ntpaths.c │ ├── once.c │ ├── os.c │ ├── resource.c │ ├── socket.c │ ├── stdio.c │ ├── stdtime.c │ ├── strerror.c │ ├── syslog.c │ ├── syslog.h │ ├── thread.c │ ├── time.c │ ├── unistd.h │ ├── version.c │ └── win32os.c │ ├── x86_32 │ └── include │ │ └── isc │ │ └── atomic.h │ └── x86_64 │ └── include │ └── isc │ └── atomic.h ├── libjsmn ├── LICENSE ├── Makefile ├── README.md ├── example │ ├── jsondump.c │ └── simple.c ├── jsmn.c ├── jsmn.h └── jsmn_test.c ├── libntp ├── Makefile.am ├── README ├── a_md5encrypt.c ├── adjtime.c ├── adjtimex.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 ├── is_ip_address.c ├── lib_strbuf.c ├── machines.c ├── mktime.c ├── modetoa.c ├── mstolfp.c ├── msyslog.c ├── netof.c ├── ntp_calendar.c ├── ntp_crypto_rnd.c ├── ntp_intres.c ├── ntp_libopts.c ├── ntp_lineedit.c ├── ntp_random.c ├── ntp_rfc2553.c ├── ntp_worker.c ├── numtoa.c ├── numtohost.c ├── octtoint.c ├── prettydate.c ├── recvbuff.c ├── refidsmear.c ├── refnumtoa.c ├── snprintf.c ├── socket.c ├── socktoa.c ├── socktohost.c ├── ssl_init.c ├── statestr.c ├── strdup.c ├── strl_obsd.c ├── syssignal.c ├── systime.c ├── systime_s.c ├── timetoa.c ├── timevalops.c ├── uglydate.c ├── vint64ops.c ├── work_fork.c ├── work_thread.c └── ymd2yd.c ├── libparse ├── Makefile.am ├── README ├── binio.c ├── clk_computime.c ├── clk_dcf7000.c ├── clk_hopf6021.c ├── clk_meinberg.c ├── clk_rawdcf.c ├── clk_rcc8000.c ├── clk_schmid.c ├── clk_sel240x.c ├── clk_trimtaip.c ├── clk_trimtsip.c ├── clk_varitext.c ├── clk_wharton.c ├── data_mbg.c ├── gpstolfp.c ├── ieee754io.c ├── info_trimble.c ├── mfp_mul.c ├── mkinfo_rcmd.sed ├── mkinfo_scmd.sed ├── parse.c ├── parse_conf.c ├── parsesolaris.c ├── parsestreams.c └── trim_info.c ├── ntpd ├── Makefile.am ├── check_y2k.c ├── cmd_args.c ├── complete.conf.in ├── declcond.h ├── invoke-ntp.conf.menu ├── invoke-ntp.conf.texi ├── invoke-ntp.keys.menu ├── invoke-ntp.keys.texi ├── invoke-ntpd.menu ├── invoke-ntpd.texi ├── jupiter.h ├── keyword-gen-utd ├── keyword-gen.c ├── ntp.conf.5man ├── ntp.conf.5mdoc ├── ntp.conf.def ├── ntp.conf.html ├── ntp.conf.man.in ├── ntp.conf.mdoc.in ├── ntp.conf.texi ├── ntp.keys.5man ├── ntp.keys.5mdoc ├── ntp.keys.def ├── ntp.keys.html ├── ntp.keys.man.in ├── ntp.keys.mdoc.in ├── ntp.keys.texi ├── ntp_config.c ├── ntp_control.c ├── ntp_crypto.c ├── ntp_filegen.c ├── ntp_io.c ├── ntp_keyword.h ├── ntp_leapsec.c ├── ntp_leapsec.h ├── ntp_loopfilter.c ├── ntp_monitor.c ├── ntp_parser.c ├── ntp_parser.h ├── ntp_parser.y ├── ntp_peer.c ├── ntp_prio_q.c ├── ntp_proto.c ├── ntp_refclock.c ├── ntp_request.c ├── ntp_restrict.c ├── ntp_scanner.c ├── ntp_scanner.h ├── ntp_signd.c ├── ntp_timer.c ├── ntp_util.c ├── ntpd-opts.c ├── ntpd-opts.def ├── ntpd-opts.h ├── ntpd.1ntpdman ├── ntpd.1ntpdmdoc ├── ntpd.c ├── ntpd.html ├── ntpd.man.in ├── ntpd.mdoc.in ├── ntpd.texi ├── ntpdbase-opts.def ├── ntpdsim-opts.c ├── ntpdsim-opts.def ├── ntpdsim-opts.h ├── ntpdsim-opts.menu ├── ntpdsim-opts.texi ├── ntpsim.c ├── ppsapi_timepps.h ├── rc_cmdlength.c ├── 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_hopfpci.c ├── refclock_hopfser.c ├── refclock_hpgps.c ├── refclock_irig.c ├── refclock_jjy.c ├── refclock_jupiter.c ├── refclock_leitch.c ├── refclock_local.c ├── refclock_msfees.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_tsyncpci.c ├── refclock_tt560.c ├── refclock_ulink.c ├── refclock_wwv.c ├── refclock_wwvb.c └── refclock_zyfer.c ├── ntpdate ├── Makefile.am ├── README ├── ntpdate.c └── ntpdate.h ├── ntpdc ├── Makefile.am ├── README ├── invoke-ntpdc.menu ├── invoke-ntpdc.texi ├── layout.std ├── nl.pl.in ├── nl_in.c ├── ntpdc-layout.c ├── ntpdc-opts.c ├── ntpdc-opts.def ├── ntpdc-opts.h ├── ntpdc.1ntpdcman ├── ntpdc.1ntpdcmdoc ├── ntpdc.c ├── ntpdc.h ├── ntpdc.html ├── ntpdc.man.in ├── ntpdc.mdoc.in ├── ntpdc.texi └── ntpdc_ops.c ├── ntpq ├── Makefile.am ├── README ├── invoke-ntpq.menu ├── invoke-ntpq.texi ├── libntpq.c ├── libntpq.h ├── libntpq_subs.c ├── ntpq-opts.c ├── ntpq-opts.def ├── ntpq-opts.h ├── ntpq-subs.c ├── ntpq.1ntpqman ├── ntpq.1ntpqmdoc ├── ntpq.c ├── ntpq.h ├── ntpq.html ├── ntpq.man.in ├── ntpq.mdoc.in └── ntpq.texi ├── ntpsnmpd ├── Makefile.am ├── README ├── invoke-ntpsnmpd.menu ├── invoke-ntpsnmpd.texi ├── netsnmp_daemonize.c ├── ntpSnmpSubagentObject.c ├── ntpSnmpSubagentObject.h ├── ntp_snmp.h ├── ntpsnmpd-opts.c ├── ntpsnmpd-opts.def ├── ntpsnmpd-opts.h ├── ntpsnmpd.1ntpsnmpdman ├── ntpsnmpd.1ntpsnmpdmdoc ├── ntpsnmpd.c ├── ntpsnmpd.html ├── ntpsnmpd.man.in ├── ntpsnmpd.mdoc.in ├── ntpsnmpd.texi └── ntpv4-mib.mib ├── packageinfo.sh ├── parseutil ├── Makefile.am ├── README ├── dcfd.c └── testdcf.c ├── ports └── winnt │ ├── include │ ├── arpa │ │ └── inet.h │ ├── clockstuff.h │ ├── config.h │ ├── gaa_compat.h │ ├── hopf_PCI_io.h │ ├── netdb.h │ ├── ntp_iocompletionport.h │ ├── ntp_timer.h │ ├── ntservice.h │ ├── stdint.h │ ├── stdnoreturn.h │ ├── sys │ │ ├── ioctl.h │ │ ├── param.h │ │ ├── resource.h │ │ ├── signal.h │ │ ├── time.h │ │ └── wait.h │ ├── syslog.h │ ├── termios.h │ ├── timepps.h │ ├── unistd.h │ └── win32_io.h │ ├── instsrv │ └── instsrv.c │ ├── libntp │ ├── MSG00001.bin │ ├── SetSystemTime.c │ ├── arc4wrap.c │ ├── getclock.c │ ├── messages.h │ ├── messages.mc │ ├── messages.rc │ ├── randfile.c │ ├── setpriority.c │ ├── syslog.c │ ├── termios.c │ ├── util_clockstuff.c │ └── win32_io.c │ ├── ntpd │ ├── hopf_PCI_io.c │ ├── nt_clockstuff.c │ ├── ntp_iocompletionport.c │ └── ntservice.c │ ├── ntptrace │ └── ntptrace.dsp │ ├── ppsapi │ ├── loopback │ │ ├── monolithic-serialpps-timepps.h │ │ ├── monolithic-serialpps-timepps.txt │ │ └── src │ │ │ ├── loopback-ppsapi.c │ │ │ ├── loopback-ppsapi.def │ │ │ ├── loopback-ppsapi.h │ │ │ ├── sys │ │ │ └── time.h │ │ │ └── timepps.h │ └── skelprov │ │ ├── skeleton-ppsapi-provider.c │ │ ├── skeleton-ppsapi-provider.def │ │ ├── skeleton-ppsapi-provider.h │ │ ├── skeleton-ppsapi-provider.sln │ │ ├── skeleton-ppsapi-provider.vcproj │ │ └── sys │ │ └── time.h │ ├── scripts │ └── mkver.bat │ ├── vs2005 │ ├── Instsrv.vcproj │ ├── libntp.vcproj │ ├── ntp.sln │ ├── ntpd.vcproj │ ├── ntpdate.vcproj │ ├── ntpdc.vcproj │ ├── ntpkeygen.vcproj │ └── ntpq.vcproj │ ├── vs2008 │ ├── common.vsprops │ ├── debug-x64.vsprops │ ├── debug.vsprops │ ├── instsrv │ │ └── instsrv.vcproj │ ├── libntp │ │ └── libntp.vcproj │ ├── loopback-pps │ │ └── loopback-ppsapi-provider.vcproj │ ├── ntp-keygen │ │ └── ntp-keygen.vcproj │ ├── ntp.sln │ ├── ntpd-keyword-gen │ │ └── ntpd-keyword-gen.vcproj │ ├── ntpd │ │ ├── gen-ntp_keyword.bat │ │ └── ntpd.vcproj │ ├── ntpdate │ │ └── ntpdate.vcproj │ ├── ntpdc │ │ └── ntpdc.vcproj │ ├── ntpq │ │ └── ntpq.vcproj │ ├── release-x64.vsprops │ └── release.vsprops │ └── vs2013 │ ├── common.props │ ├── debug-x64.props │ ├── debug.props │ ├── instsrv │ ├── instsrv.vcxproj │ └── instsrv.vcxproj.filters │ ├── libntp │ ├── libntp.vcxproj │ └── libntp.vcxproj.filters │ ├── loopback-pps │ ├── loopback-ppsapi-provider.vcxproj │ └── loopback-ppsapi-provider.vcxproj.filters │ ├── ntp-keygen │ ├── ntp-keygen.vcxproj │ └── ntp-keygen.vcxproj.filters │ ├── ntp.sln │ ├── ntpd-keyword-gen │ ├── ntpd-keyword-gen.vcxproj │ └── ntpd-keyword-gen.vcxproj.filters │ ├── ntpd │ ├── gen-ntp_keyword.bat │ ├── ntpd.vcxproj │ └── ntpd.vcxproj.filters │ ├── ntpdate │ ├── ntpdate.vcxproj │ └── ntpdate.vcxproj.filters │ ├── ntpdc │ ├── ntpdc.vcxproj │ └── ntpdc.vcxproj.filters │ ├── ntpq │ ├── ntpq.vcxproj │ └── ntpq.vcxproj.filters │ ├── release-x64.props │ └── release.props ├── readme.y2kfixes ├── results.y2kfixes ├── scripts ├── Makefile.am ├── README ├── build │ ├── Makefile.am │ ├── UpdatePoint │ ├── VersionName │ ├── addChangeLogTag │ ├── check--help │ ├── checkChangeLog │ ├── checkHtmlFileDates │ ├── fixautomakedepsmagic │ ├── genChangeLogTag │ ├── genCommitLog │ ├── genver │ ├── mkver.in │ └── updateBEDate ├── calc_tickadj │ ├── Makefile.am │ ├── calc_tickadj-opts │ ├── calc_tickadj-opts.def │ ├── calc_tickadj.1calc_tickadjman │ ├── calc_tickadj.1calc_tickadjmdoc │ ├── calc_tickadj.html │ ├── calc_tickadj.in │ ├── calc_tickadj.man.in │ ├── calc_tickadj.mdoc.in │ ├── calc_tickadj.texi │ ├── invoke-calc_tickadj.menu │ └── invoke-calc_tickadj.texi ├── deprecated │ ├── freq_adj.in │ ├── hpadjtime.sh │ ├── html2man.in │ ├── ntp-close │ ├── ntp-groper │ ├── ntp-restart │ └── ntp-status ├── invoke-plot_summary.menu ├── invoke-plot_summary.texi ├── invoke-summary.menu ├── invoke-summary.texi ├── lib │ ├── Makefile.am │ └── NTP │ │ ├── Mode6 │ │ └── Packet.pm │ │ └── Util.pm ├── monitoring │ ├── README │ ├── loopwatch.config.SAMPLE │ ├── lr.pl │ ├── ntp.pl │ ├── ntploopstat │ ├── ntploopwatch │ ├── ntptrap │ └── timelocal.pl ├── ntp-wait │ ├── Makefile.am │ ├── invoke-ntp-wait.menu │ ├── invoke-ntp-wait.texi │ ├── ntp-wait-opts │ ├── ntp-wait-opts.def │ ├── ntp-wait.1ntp-waitman │ ├── ntp-wait.1ntp-waitmdoc │ ├── ntp-wait.html │ ├── ntp-wait.in │ ├── ntp-wait.man.in │ ├── ntp-wait.mdoc.in │ └── ntp-wait.texi ├── ntpsweep │ ├── Makefile.am │ ├── invoke-ntpsweep.menu │ ├── invoke-ntpsweep.texi │ ├── ntpsweep-opts │ ├── ntpsweep-opts.def │ ├── ntpsweep.1ntpsweepman │ ├── ntpsweep.1ntpsweepmdoc │ ├── ntpsweep.html │ ├── ntpsweep.in │ ├── ntpsweep.man.in │ ├── ntpsweep.mdoc.in │ └── ntpsweep.texi ├── ntptrace │ ├── Makefile.am │ ├── invoke-ntptrace.menu │ ├── invoke-ntptrace.texi │ ├── ntptrace-opts │ ├── ntptrace-opts.def │ ├── ntptrace.1ntptraceman │ ├── ntptrace.1ntptracemdoc │ ├── ntptrace.html │ ├── ntptrace.in │ ├── ntptrace.man.in │ ├── ntptrace.mdoc.in │ └── ntptrace.texi ├── ntpver.in ├── plot_summary-opts ├── plot_summary-opts.def ├── plot_summary.1plot_summaryman ├── plot_summary.1plot_summarymdoc ├── plot_summary.html ├── plot_summary.in ├── plot_summary.man.in ├── plot_summary.mdoc.in ├── plot_summary.texi ├── rc │ ├── README │ ├── ntpd │ ├── ntpwait │ └── rc.d │ │ ├── TIMESYNC │ │ ├── ntpd │ │ └── ntpwait ├── rc1 │ ├── postinstall │ ├── preinstall │ ├── preremove │ ├── prototype │ └── xntp ├── rc2 │ └── local.ntpd ├── stats │ ├── README │ ├── README.stats │ ├── README.timecodes │ ├── clock.awk │ ├── dupe.awk │ ├── ensemble.S │ ├── ensemble.awk │ ├── etf.S │ ├── etf.awk │ ├── itf.S │ ├── itf.awk │ ├── loop.S │ ├── loop.awk │ ├── loop_summary │ ├── peer.awk │ ├── psummary.awk │ ├── summary.sh │ ├── tdata.S │ └── tdata.awk ├── summary-opts ├── summary-opts.def ├── summary.1summaryman ├── summary.1summarymdoc ├── summary.html ├── summary.in ├── summary.man.in ├── summary.mdoc.in ├── summary.texi ├── t │ ├── 1_common.t │ ├── calc_tickadj.t │ ├── lib │ │ └── Test │ │ │ ├── Command.pm │ │ │ ├── Mode6 │ │ │ └── Server.pm │ │ │ └── Util.pm │ ├── ntp-wait.t │ ├── ntpsweep.t │ ├── ntptrace.t │ ├── plot_summary.t │ ├── summary.t │ └── util.t └── update-leap │ ├── Makefile.am │ ├── invoke-update-leap.menu │ ├── invoke-update-leap.texi │ ├── update-leap-opts │ ├── update-leap-opts.def │ ├── update-leap.1update-leapman │ ├── update-leap.1update-leapmdoc │ ├── update-leap.html │ ├── update-leap.in │ ├── update-leap.man.in │ ├── update-leap.mdoc.in │ ├── update-leap.sh │ └── update-leap.texi ├── sntp ├── Makefile.am ├── ag-tpl │ ├── 0-old │ │ ├── Mdoc.pm │ │ ├── agman-cmd.tpl │ │ ├── agmdoc-cmd.tpl │ │ ├── cmd-doc.tlib │ │ ├── mdoc-synopsis.tlib │ │ ├── mdoc2man │ │ ├── mdoc2texi │ │ └── perlopt.tpl │ ├── Mdoc.pm │ └── mdoc2man ├── check-libntp.mf ├── check-libopts.mf ├── configure.ac ├── crypto.c ├── crypto.h ├── data_formats.h ├── deps-ver ├── fetch-stubs ├── include │ ├── Makefile.am │ ├── autogen-version.def │ ├── copyright.def │ ├── debug-opt.def │ ├── homerc.def │ └── ntp.lic ├── includes.mf ├── invoke-sntp.menu ├── invoke-sntp.texi ├── kod_management.c ├── kod_management.h ├── libevent │ ├── ChangeLog │ ├── ChangeLog-1.4 │ ├── ChangeLog-2.0 │ ├── Doxyfile │ ├── LICENSE │ ├── Makefile.am │ ├── Makefile.nmake │ ├── README.md │ ├── WIN32-Code │ │ ├── getopt.c │ │ ├── getopt.h │ │ ├── getopt_long.c │ │ ├── nmake │ │ │ ├── evconfig-private.h │ │ │ └── event2 │ │ │ │ └── event-config.h │ │ └── tree.h │ ├── arc4random.c │ ├── autogen.sh │ ├── buffer.c │ ├── buffer_iocp.c │ ├── bufferevent-internal.h │ ├── bufferevent.c │ ├── bufferevent_async.c │ ├── bufferevent_filter.c │ ├── bufferevent_openssl.c │ ├── bufferevent_pair.c │ ├── bufferevent_ratelim.c │ ├── bufferevent_sock.c │ ├── changelist-internal.h │ ├── compat │ │ └── sys │ │ │ └── queue.h │ ├── configure.ac │ ├── defer-internal.h │ ├── devpoll.c │ ├── epoll.c │ ├── epoll_sub.c │ ├── epolltable-internal.h │ ├── evbuffer-internal.h │ ├── evconfig-private.h.in │ ├── evdns.c │ ├── event-internal.h │ ├── event.c │ ├── event_iocp.c │ ├── event_rpcgen.py │ ├── event_tagging.c │ ├── evmap-internal.h │ ├── evmap.c │ ├── evport.c │ ├── evrpc-internal.h │ ├── evrpc.c │ ├── evsignal-internal.h │ ├── evthread-internal.h │ ├── evthread.c │ ├── evthread_pthread.c │ ├── evthread_win32.c │ ├── evutil.c │ ├── evutil_rand.c │ ├── evutil_time.c │ ├── ht-internal.h │ ├── http-internal.h │ ├── http.c │ ├── include │ │ ├── evdns.h │ │ ├── event.h │ │ ├── event2 │ │ │ ├── buffer.h │ │ │ ├── buffer_compat.h │ │ │ ├── bufferevent.h │ │ │ ├── bufferevent_compat.h │ │ │ ├── bufferevent_ssl.h │ │ │ ├── bufferevent_struct.h │ │ │ ├── dns.h │ │ │ ├── dns_compat.h │ │ │ ├── dns_struct.h │ │ │ ├── event.h │ │ │ ├── event_compat.h │ │ │ ├── event_struct.h │ │ │ ├── http.h │ │ │ ├── http_compat.h │ │ │ ├── http_struct.h │ │ │ ├── keyvalq_struct.h │ │ │ ├── listener.h │ │ │ ├── rpc.h │ │ │ ├── rpc_compat.h │ │ │ ├── rpc_struct.h │ │ │ ├── tag.h │ │ │ ├── tag_compat.h │ │ │ ├── thread.h │ │ │ ├── util.h │ │ │ └── visibility.h │ │ ├── evhttp.h │ │ ├── evrpc.h │ │ ├── evutil.h │ │ └── include.am │ ├── iocp-internal.h │ ├── ipv6-internal.h │ ├── kqueue-internal.h │ ├── kqueue.c │ ├── libevent.pc.in │ ├── libevent_openssl.pc.in │ ├── libevent_pthreads.pc.in │ ├── listener.c │ ├── log-internal.h │ ├── log.c │ ├── m4 │ │ ├── ac_backport_259_ssizet.m4 │ │ ├── acx_pthread.m4 │ │ ├── libevent_openssl.m4 │ │ └── ntp_pkg_config.m4 │ ├── make-event-config.sed │ ├── minheap-internal.h │ ├── mm-internal.h │ ├── poll.c │ ├── ratelim-internal.h │ ├── sample │ │ ├── dns-example.c │ │ ├── event-read-fifo.c │ │ ├── hello-world.c │ │ ├── hostcheck.c │ │ ├── hostcheck.h │ │ ├── http-server.c │ │ ├── https-client.c │ │ ├── include.am │ │ ├── le-proxy.c │ │ ├── openssl_hostname_validation.c │ │ ├── openssl_hostname_validation.h │ │ ├── signal-test.c │ │ └── time-test.c │ ├── select.c │ ├── signal.c │ ├── strlcpy-internal.h │ ├── strlcpy.c │ ├── test │ │ ├── Makefile.nmake │ │ ├── bench.c │ │ ├── bench_cascade.c │ │ ├── bench_http.c │ │ ├── bench_httpclient.c │ │ ├── check-dumpevents.py │ │ ├── include.am │ │ ├── print-winsock-errors.c │ │ ├── regress.c │ │ ├── regress.h │ │ ├── regress.rpc │ │ ├── regress_buffer.c │ │ ├── regress_bufferevent.c │ │ ├── regress_dns.c │ │ ├── regress_et.c │ │ ├── regress_finalize.c │ │ ├── regress_http.c │ │ ├── regress_iocp.c │ │ ├── regress_listener.c │ │ ├── regress_main.c │ │ ├── regress_minheap.c │ │ ├── regress_rpc.c │ │ ├── regress_ssl.c │ │ ├── regress_testutils.c │ │ ├── regress_testutils.h │ │ ├── regress_thread.c │ │ ├── regress_thread.h │ │ ├── regress_util.c │ │ ├── regress_zlib.c │ │ ├── rpcgen_wrapper.sh │ │ ├── test-changelist.c │ │ ├── test-closed.c │ │ ├── test-dumpevents.c │ │ ├── test-eof.c │ │ ├── test-fdleak.c │ │ ├── test-init.c │ │ ├── test-ratelim.c │ │ ├── test-ratelim.sh │ │ ├── test-time.c │ │ ├── test-weof.c │ │ ├── test.sh │ │ ├── tinytest.c │ │ ├── tinytest.h │ │ ├── tinytest_demo.c │ │ ├── tinytest_local.h │ │ └── tinytest_macros.h │ ├── time-internal.h │ ├── util-internal.h │ ├── whatsnew-2.0.txt │ ├── whatsnew-2.1.txt │ └── win32select.c ├── libopts │ ├── COPYING.gplv3 │ ├── COPYING.lgplv3 │ ├── COPYING.mbsd │ ├── MakeDefs.inc │ ├── Makefile.am │ ├── README │ ├── ag-char-map.h │ ├── alias.c │ ├── ao-strs.c │ ├── ao-strs.h │ ├── autoopts.c │ ├── autoopts.h │ ├── autoopts │ │ ├── options.h │ │ ├── project.h │ │ └── usage-txt.h │ ├── boolean.c │ ├── check.c │ ├── compat │ │ ├── _Noreturn.h │ │ ├── compat.h │ │ ├── pathfind.c │ │ ├── snprintf.c │ │ ├── strchr.c │ │ ├── strdup.c │ │ └── 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 │ ├── libopts.c │ ├── load.c │ ├── m4 │ │ ├── libopts.m4 │ │ ├── liboptschk.m4 │ │ └── stdnoreturn.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 ├── libpkgver │ ├── colcomp.c │ └── pkgver.h ├── loc │ ├── README │ ├── darwin │ ├── debian │ ├── freebsd │ ├── legacy │ ├── netbsd │ ├── redhat │ └── solaris ├── log.c ├── log.h ├── m4 │ ├── LICENSE-OPENLDAP │ ├── ax_c99_struct_init.m4 │ ├── define_dir.m4 │ ├── hms_search_lib.m4 │ ├── ntp_cacheversion.m4 │ ├── ntp_compiler.m4 │ ├── ntp_crosscompile.m4 │ ├── ntp_crypto_rand.m4 │ ├── ntp_debug.m4 │ ├── ntp_dir_sep.m4 │ ├── ntp_facilitynames.m4 │ ├── ntp_googletest.m4 │ ├── ntp_ipv6.m4 │ ├── ntp_lib_m.m4 │ ├── ntp_libevent.m4 │ ├── ntp_libntp.m4 │ ├── ntp_lineeditlibs.m4 │ ├── ntp_locinfo.m4 │ ├── ntp_openssl.m4 │ ├── ntp_pkg_config.m4 │ ├── ntp_problemtests.m4 │ ├── ntp_prog_cc.m4 │ ├── ntp_rlimit.m4 │ ├── ntp_sntp.m4 │ ├── ntp_sysexits.m4 │ ├── ntp_unitytest.m4 │ ├── ntp_ver_suffix.m4 │ ├── ntp_vpathhack.m4 │ ├── openldap-thread-check.m4 │ ├── openldap.m4 │ ├── os_cflags.m4 │ └── snprintf.m4 ├── main.c ├── main.h ├── networking.c ├── networking.h ├── scripts │ ├── Makefile.am │ ├── cvo.sh │ ├── genLocInfo │ └── mansec2subst.sed ├── sntp-opts.c ├── sntp-opts.def ├── sntp-opts.h ├── sntp.1sntpman ├── sntp.1sntpmdoc ├── sntp.c ├── sntp.html ├── sntp.man.in ├── sntp.mdoc.in ├── sntp.texi ├── tests │ ├── Makefile.am │ ├── crypto.c │ ├── data │ │ ├── debug-input-lfp-bin │ │ ├── debug-input-lfp-dec │ │ ├── debug-input-pkt │ │ ├── debug-output-lfp-bin │ │ ├── debug-output-lfp-dec │ │ ├── debug-output-pkt │ │ ├── key-test-ascii │ │ ├── key-test-comments │ │ ├── key-test-empty │ │ ├── key-test-hex │ │ ├── key-test-invalid-hex │ │ ├── kod-expected-multiple │ │ ├── kod-expected-single │ │ ├── kod-output-blank │ │ ├── kod-output-multiple │ │ ├── kod-output-single │ │ ├── kod-test-blanks │ │ ├── kod-test-correct │ │ └── kod-test-empty │ ├── fileHandlingTest.c │ ├── fileHandlingTest.h.in │ ├── keyFile.c │ ├── kodDatabase.c │ ├── kodFile.c │ ├── nameresolution.c │ ├── networking.c │ ├── packetHandling.c │ ├── packetProcessing.c │ ├── run-crypto.c │ ├── run-keyFile.c │ ├── run-kodDatabase.c │ ├── run-kodFile.c │ ├── run-nameresolution.c │ ├── run-networking.c │ ├── run-packetHandling.c │ ├── run-packetProcessing.c │ ├── run-t-log.c │ ├── run-utilities.c │ ├── sntptest.c │ ├── sntptest.h │ ├── t-log.c │ ├── tests-runner │ └── utilities.c ├── unity │ ├── Makefile.am │ ├── auto │ │ ├── colour_prompt.rb │ │ ├── colour_reporter.rb │ │ ├── generate_config.yml │ │ ├── generate_module.rb │ │ ├── generate_test_runner.rb │ │ ├── parseOutput.rb │ │ ├── runner_maybe.c │ │ ├── test_file_filter.rb │ │ ├── type_sanitizer.rb │ │ ├── unity_test_summary.py │ │ └── unity_test_summary.rb │ ├── license.txt │ ├── unity.c │ ├── unity.h │ ├── unity_config.h │ ├── unity_fixture.c │ ├── unity_fixture.h │ ├── unity_fixture_internals.h │ ├── unity_fixture_malloc_overrides.h │ └── unity_internals.h ├── utilities.c └── utilities.h ├── tests ├── Makefile.am ├── bug-2803 │ ├── Makefile.am │ ├── bug-2803.c │ └── run-bug-2803.c ├── libntp │ ├── Makefile.am │ ├── a_md5encrypt.c │ ├── atoint.c │ ├── atouint.c │ ├── authkeys.c │ ├── buftvtots.c │ ├── calendar.c │ ├── caljulian.c │ ├── caltontp.c │ ├── calyearstart.c │ ├── clocktime.c │ ├── decodenetnum.c │ ├── hextoint.c │ ├── hextolfp.c │ ├── humandate.c │ ├── lfpfunc.c │ ├── lfptest.c │ ├── lfptest.h │ ├── lfptostr.c │ ├── modetoa.c │ ├── msyslog.c │ ├── netof.c │ ├── numtoa.c │ ├── numtohost.c │ ├── octtoint.c │ ├── prettydate.c │ ├── recvbuff.c │ ├── refidsmear.c │ ├── refnumtoa.c │ ├── run-a_md5encrypt.c │ ├── run-atoint.c │ ├── run-atouint.c │ ├── run-authkeys.c │ ├── run-buftvtots.c │ ├── run-calendar.c │ ├── run-caljulian.c │ ├── run-caltontp.c │ ├── run-calyearstart.c │ ├── run-clocktime.c │ ├── run-decodenetnum.c │ ├── run-hextoint.c │ ├── run-hextolfp.c │ ├── run-humandate.c │ ├── run-lfpfunc.c │ ├── run-lfptostr.c │ ├── run-modetoa.c │ ├── run-msyslog.c │ ├── run-netof.c │ ├── run-numtoa.c │ ├── run-numtohost.c │ ├── run-octtoint.c │ ├── run-prettydate.c │ ├── run-recvbuff.c │ ├── run-refidsmear.c │ ├── run-refnumtoa.c │ ├── run-sfptostr.c │ ├── run-socktoa.c │ ├── run-ssl_init.c │ ├── run-statestr.c │ ├── run-strtolfp.c │ ├── run-timespecops.c │ ├── run-timevalops.c │ ├── run-tstotv.c │ ├── run-tvtots.c │ ├── run-uglydate.c │ ├── run-vi64ops.c │ ├── run-ymd2yd.c │ ├── sfptostr.c │ ├── sockaddrtest.c │ ├── sockaddrtest.h │ ├── socktoa.c │ ├── ssl_init.c │ ├── statestr.c │ ├── strtolfp.c │ ├── test-libntp.c │ ├── test-libntp.h │ ├── timespecops.c │ ├── timestructs.c │ ├── timestructs.h │ ├── timevalops.c │ ├── tstotv.c │ ├── tvtots.c │ ├── uglydate.c │ ├── vi64ops.c │ └── ymd2yd.c ├── ntpd │ ├── Makefile.am │ ├── leapsec.c │ ├── ntp_prio_q.c │ ├── ntp_restrict.c │ ├── ntp_util.c │ ├── rc_cmdlength.c │ ├── run-leapsec.c │ ├── run-ntp_prio_q.c │ ├── run-ntp_restrict.c │ ├── run-ntp_util.c │ ├── run-rc_cmdlength.c │ ├── run-t-ntp_scanner.c │ ├── run-t-ntp_signd.c │ ├── t-ntp_scanner.c │ └── t-ntp_signd.c ├── ntpq │ ├── Makefile.am │ ├── run-t-ntpq.c │ └── t-ntpq.c ├── sandbox │ ├── Makefile.am │ ├── bug-2803.c │ ├── bug-2803.h │ ├── modetoa.c │ ├── run-bug-2803.c │ ├── run-modetoa.c │ ├── run-uglydate.c │ ├── run-ut-2803.c │ ├── smeartest.c │ ├── test-2803.c │ ├── uglydate.c │ └── ut-2803.c └── sec-2853 │ ├── Makefile.am │ ├── run-sec-2853.c │ └── sec-2853.c └── util ├── Makefile.am ├── README ├── audio-pcm.c ├── byteorder.c ├── hist.c ├── invoke-ntp-keygen.menu ├── invoke-ntp-keygen.texi ├── jitter.c ├── kern.c ├── longsize.c ├── ntp-keygen-opts.c ├── ntp-keygen-opts.def ├── ntp-keygen-opts.h ├── ntp-keygen.1ntp-keygenman ├── ntp-keygen.1ntp-keygenmdoc ├── ntp-keygen.c ├── ntp-keygen.html ├── ntp-keygen.man.in ├── ntp-keygen.mdoc.in ├── ntp-keygen.texi ├── ntptime.c ├── pps-api.c ├── precision.c ├── sht.c ├── testrs6000.c ├── tg.c ├── tg2.c ├── tickadj.c └── timetrim.c /README.bk: -------------------------------------------------------------------------------- 1 | In order to use the BitKeeper repository version of NTP you should visit 2 | 3 | http://support.ntp.org/Main/SoftwareDevelopment 4 | 5 | for important information. 6 | 7 | If you want to submit patches, please see the README.hackers file. 8 | -------------------------------------------------------------------------------- /README.hackers: -------------------------------------------------------------------------------- 1 | Notes to hackers. 2 | 3 | See README.patches for information about submitting patches. 4 | 5 | --- 6 | 7 | Dave likes this code indented formatted in a consistent way. 8 | The file "dot.emacs" has the emacs C-mode indentation style that Dave likes. 9 | 10 | --- 11 | 12 | We'd like to see *all* system function declarations live in include/l_stdlib.h 13 | and NEVER appear in the .c files. 14 | 15 | --- 16 | -------------------------------------------------------------------------------- /README.simulator: -------------------------------------------------------------------------------- 1 | 2 | README for the NTPD Simulator 3 | ----------------------------- 4 | 5 | 6 | ntpdsim 7 | -O 8 | -T 9 | -W 10 | -J 11 | -K 12 | -Y 13 | -Z 14 | -C 15 | -B 16 | -H 17 | -I 18 | -S 19 | 20 | -------------------------------------------------------------------------------- /README.versions: -------------------------------------------------------------------------------- 1 | 2 | NTP uses A.B.C - style release numbers. 3 | 4 | At the moment: 5 | 6 | A is 4, for ntp V4. 7 | B is the major release number. 8 | C is the minor release number. Even numbers are 'stable' releases and 9 | odd numbers are "development" releases. 10 | 11 | Following the release number may be the letter 'p' followed by a number. 12 | This indicates a point (or patch) release. 13 | 14 | Release candidates have -RC in the release number. 15 | 16 | Here are some recent versions numbers as an example: 17 | 18 | 4.2.2 A production release (from the ntp-stable repository) 19 | 4.2.2p2 A production release (from the ntp-stable repository) 20 | 4.2.3p12 A development release 21 | 4.2.3p15-rc1 A release candidate for 4.2.4 22 | 23 | Note that after the ntp-dev repo produces a production release it will 24 | be copied into the ntp-stable and the cycle will repeat. 25 | 26 | Feel free to suggest improvements... 27 | 28 | -------------------------------------------------------------------------------- /adjtimed/Makefile.am: -------------------------------------------------------------------------------- 1 | ## adjtimed Makefile.am 2 | 3 | bin_PROGRAMS = $(ADJTIMED_DB) 4 | libexec_PROGRAMS = $(ADJTIMED_DL) 5 | sbin_PROGRAMS = $(ADJTIMED_DS) 6 | 7 | BUILT_SOURCES = 8 | CLEANFILES = 9 | EXTRA_PROGRAMS = adjtimed 10 | 11 | AM_CFLAGS = $(CFLAGS_NTP) 12 | 13 | AM_CPPFLAGS = $(NTP_INCS) 14 | AM_CPPFLAGS += $(CPPFLAGS_NTP) 15 | 16 | LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) 17 | 18 | include $(top_srcdir)/bincheck.mf 19 | include $(top_srcdir)/sntp/check-libntp.mf 20 | include $(top_srcdir)/depsver.mf 21 | include $(top_srcdir)/includes.mf 22 | -------------------------------------------------------------------------------- /adjtimed/README: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | The adjtimed daemon emulates the BSD adjtime(2) system call. The 3 | adjtime() routine communicates with this daemon via SYSV messages. 4 | 5 | The emulation uses an undocumented kernel variable (as of 6.0/2.0 6 | and later releases) and as such it cannot be guaranteed to work in 7 | future HP-UX releases. Perhaps HP-UX will have a real adjtime(2) 8 | system call in the future. 9 | 10 | Author: Tai Jin (tai@sde.hp.com) 11 | ------------------------------------------------------------------------------ 12 | 13 | IMPORTANT NOTE: This stuff must be compiled with no optimization !! 14 | 15 | NOTE: This code is known to work as of 8.0 on s300's, s700's and s800's. 16 | PLEASE do not modify it unless you have access to kernel sources 17 | and fully understand the implications of any changes you are making. 18 | One person already has trashed adjtimed by making it do "the right 19 | thing". This is not an exact replacement for BSD adjtime(2), don't 20 | try to make it into one. 21 | 22 | -- Ken 23 | -------------------------------------------------------------------------------- /bincheck.mf: -------------------------------------------------------------------------------- 1 | # we traditionally installed software in bindir, while it should have gone 2 | # in sbindir. Now that we offer a choice, look in the "other" installation 3 | # subdir to warn folks if there is another version there. 4 | 5 | install-exec-hook: 6 | @test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \ 7 | || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \ 8 | test ! -f ${sbindir}/$$i \ 9 | || echo "*** $$i is also in ${sbindir}!"; \ 10 | done 11 | @test -z "${sbin_PROGRAMS}${asbin_SCRIPTS}" \ 12 | || for i in ${sbin_PROGRAMS} ${sbin_SCRIPTS} " "; do \ 13 | test ! -f ${bindir}/$$i \ 14 | || echo "*** $$i is also in ${bindir}!"; \ 15 | done 16 | 17 | # 18 | -------------------------------------------------------------------------------- /br-flock: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | IAM=`hostname || uname -n` 4 | MYNAME=`IFS=. ; set $IAM ; echo $1` 5 | 6 | case "$1" in 7 | '--one'|'-1') 8 | shift 9 | FB_FIRSTONLY=-1 10 | LIST=$MYNAME 11 | ;; 12 | *) 13 | FB_FIRSTONLY= 14 | esac 15 | 16 | case "$LIST" in 17 | '') LIST="deacon barnstable beauregard grundoon howland mort macabre";; 18 | esac 19 | 20 | export LIST 21 | flock-build $FB_FIRSTONLY --disable-parse-clocks --with-loc=legacy --enable-local-libopts --enable-local-libevent "$@" 22 | -------------------------------------------------------------------------------- /check-libopts.mf: -------------------------------------------------------------------------------- 1 | ## check-libopts.mf - automake fragment 2 | ## 3 | ## If we are not using the tearoff libopts, we won't be 4 | ## building its libopts.la, so the submake is allowed 5 | ## to fail. 6 | 7 | BUILT_SOURCES += check-libopts 8 | CLEANFILES += check-libopts 9 | 10 | check-libopts: ../sntp/libopts/libopts.la 11 | @echo stamp > $@ 12 | 13 | ../sntp/libopts/libopts.la: 14 | -cd ../sntp/libopts && $(MAKE) $(AM_MAKEFLAGS) libopts.la 15 | -------------------------------------------------------------------------------- /clockstuff/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_PROGRAMS = @PROPDELAY@ @CHUTEST@ 2 | EXTRA_PROGRAMS = propdelay chutest 3 | 4 | AM_CFLAGS = $(CFLAGS_NTP) 5 | 6 | AM_CPPFLAGS = $(NTP_INCS) 7 | AM_CPPFLAGS += $(CPPFLAGS_NTP) 8 | 9 | LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) 10 | propdelay_LDADD = $(LDADD) 11 | 12 | BUILT_SOURCES = 13 | CLEANFILES = 14 | 15 | include $(top_srcdir)/sntp/check-libntp.mf 16 | include $(top_srcdir)/depsver.mf 17 | include $(top_srcdir)/includes.mf 18 | -------------------------------------------------------------------------------- /clockstuff/README: -------------------------------------------------------------------------------- 1 | README file for directory ./clockstuff of the NTP Version 4 distribution 2 | 3 | This directory contains the sources for utility programs designed to 4 | support radio clocks. chutest.c is desgined to test the depredated 5 | chu_clk line discipline or STREAMS module and can also test a CHU 6 | modem in raw mode. 7 | 8 | You can make things in here by typing one or more of: 9 | 10 | make propdelay (or `make') 11 | make chutest 12 | 13 | Propdelay computes high frequency propagation delays, given the 14 | longitude and latitude of the transmitter and receiver. Use 15 | this for WWV/H and CHU. Don't use it for WWVB (the computation 16 | is easier for that). 17 | 18 | Chutest can be used to input and process data from a CHU modem 19 | attached to a serial port. It will use the CHU line discipline 20 | (if installed), or raw mode otherwise. This was used to test 21 | out the initial reduction algorithms, and may not be up to date. 22 | -------------------------------------------------------------------------------- /conf/README: -------------------------------------------------------------------------------- 1 | README file for directory ./conf of the NTP Version 4 distribution 2 | 3 | This directory contains example run-time configuration files for the 4 | NTP Version 4 daemon ntpd. These files illustrate some of the more 5 | obtuse configurations you may run into. They are not likely to do 6 | anything good if run on machines other than their native spot, so don't 7 | just blindly copy something and put it up. Additional information can 8 | be found in the ./doc directory of the base directory. 9 | 10 | Included also are example public key and symmetric key files produced 11 | by the ntp-genkeys program with names prefixed by ntpkey. These are 12 | ordinarily kept in /usr/local/etc and used by the Autokey scheme. See 13 | the authopt.htm pnd genkeys.htm ages for further information. 14 | -------------------------------------------------------------------------------- /conf/baldwin.conf: -------------------------------------------------------------------------------- 1 | # 2 | # NTP manycast configuration file (ntp.conf) for DCnet hosts 3 | # 4 | # Note that the .rnd random seed file must pe in the root 5 | # directory and the public and private keys in /usr/local/etc. 6 | # 7 | manycastclient 239.1.1.1 autokey maxpoll 12 8 | manycastserver 239.1.1.1 9 | crypto randfile /.rnd # enable public key 10 | driftfile /etc/ntp.drift # path for drift file 11 | -------------------------------------------------------------------------------- /conf/beauregard.conf: -------------------------------------------------------------------------------- 1 | # 2 | # NTP configuration file (ntp.conf) 3 | # beauregard.udel.edu 4 | # 5 | server 127.127.18.1 # NIST ACTS modem driver 6 | fudge 127.127.18.1 time1 .0035 7 | phone atdt913034944774 atdt913034944785 atdt913034944774 8 | #phone atdt913034944812 atdt913034948497 atdt913034948022 9 | # 10 | # Miscellaneous stuff 11 | # 12 | driftfile /etc/ntp.drift # path for drift file 13 | statsdir /beauregard/ntpstats/ # directory for statistics files 14 | filegen peerstats file peerstats type day enable 15 | filegen loopstats file loopstats type day enable 16 | filegen clockstats file clockstats type day enable 17 | # 18 | # Authentication stuff 19 | # 20 | keys /usr/local/etc/ntp.keys # path for keys file 21 | trustedkey 3 4 5 6 14 15 # define trusted keys 22 | requestkey 15 # key (7) for accessing server variables 23 | controlkey 15 # key (6) for accessing server variables 24 | -------------------------------------------------------------------------------- /conf/malarky.conf: -------------------------------------------------------------------------------- 1 | # 2 | # NTP configuration file (ntp.conf) 3 | # 4 | # This is for a broadcast/multicast client. Except for the statistics 5 | # stuff, this can be done with only a commmand line of the form 6 | # 7 | # /usr/local/bin/ntpd -a -k /usr/local/bin/ntp.keys -m -t 3 8 | # 9 | multicastclient # listen on default 224.0.1.1 10 | # 11 | # Miscellaneous stuff 12 | # 13 | driftfile /etc/ntp.drift # path for drift file 14 | statsdir /malarky/ntpstats/ # directory for statistics files 15 | filegen peerstats file peerstats type day enable 16 | filegen loopstats file loopstats type day enable 17 | filegen clockstats file clockstats type day enable 18 | # 19 | # Authentication stuff 20 | # 21 | keys /usr/local/etc/ntp.keys # path for key file 22 | trustedkey 3 4 5 6 14 # define trusted keys 23 | requestkey 14 # key (7) for accessing server variables 24 | controlkey 14 # key (6) for accessing server variables 25 | -------------------------------------------------------------------------------- /deps-ver: -------------------------------------------------------------------------------- 1 | Fri Dec 30 11:24:57 UTC 2011 2 | -------------------------------------------------------------------------------- /dot.emacs: -------------------------------------------------------------------------------- 1 | ;; This is how Dave Mills likes to see the NTP code formatted. 2 | 3 | (defconst ntp-c-style 4 | '((c-basic-offset . 8) 5 | (fill-column . 72) 6 | (c-offsets-alist . ((arglist-intro . +) 7 | (case-label . *) 8 | (statement-case-intro . *) 9 | (statement-cont . *) 10 | (substatement-open . 0)))) 11 | "David L. Mills; NTP code indentation style") 12 | 13 | (defun ntp-c-mode-common-hook () 14 | ;; add ntp c style 15 | (c-add-style "ntp" ntp-c-style nil)) 16 | 17 | (add-hook 'c-mode-common-hook 'ntp-c-mode-common-hook) 18 | 19 | ;; 1997112600 20 | -------------------------------------------------------------------------------- /html/build.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/build.html -------------------------------------------------------------------------------- /html/drivers/icons/home.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/drivers/icons/home.gif -------------------------------------------------------------------------------- /html/drivers/icons/mail2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/drivers/icons/mail2.gif -------------------------------------------------------------------------------- /html/drivers/scripts/footer.txt: -------------------------------------------------------------------------------- 1 | document.write("\ 2 | \ 3 | \ 5 | \ 7 | \ 9 |
\ 4 | Home Page\ 6 | Site Map\ 8 | Contacts
") 10 | -------------------------------------------------------------------------------- /html/hints/changes: -------------------------------------------------------------------------------- 1 | Ulrich Windl (xntpd/refclock_parse.c): 2 | - Added support to supply power from RS232 with CLOCK_RAWDCF. 3 | Known to work with Linux 1.2. 4 | - Made Linux ignore parity errors with CLOCK_RAWDCF. 5 | 6 | Ulrich Windl (parse/util/dcfd.c): 7 | - Removed conflicting prototype for Linux (sscanf) 8 | - Corrected spelling error 9 | - Made Linux ignore parity errors. 10 | - Added support to supply power from RS232 with CLOCK_RAWDCF. 11 | 12 | Ulrich Windl (parse/util/testdcf.c): 13 | - Made Linux ignore parity errors. 14 | -------------------------------------------------------------------------------- /html/hints/freebsd: -------------------------------------------------------------------------------- 1 | If you are compiling under FreeBSD and see messages in the syslogs that 2 | indicate that the ntpd process is trying to use unavailable sched_ 3 | calls, it means you are running a kernel that does not have the POSIX 4 | scheduling calls enabled. 5 | 6 | You have two choices: 7 | 8 | - Ignore the messages 9 | 10 | - Generate a new kernel, where the kernel configuration file contains 11 | the lines: 12 | 13 | options "P1003_1B" 14 | options "_KPOSIX_PRIORITY_SCHEDULING" 15 | options "_KPOSIX_VERSION=199309L" 16 | -------------------------------------------------------------------------------- /html/hints/linux: -------------------------------------------------------------------------------- 1 | The kernel PLL interface is broken, I know. 2 | Update RSN. 3 | 4 | Torsten 5 | (duwe@informatik.uni-erlangen.de) 6 | -------------------------------------------------------------------------------- /html/hints/solaris.xtra.S99ntpd: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ $1 = "start" ]; then 3 | if [ -x /usr/local/bin/xntpd ]; then 4 | echo "Starting NTP daemon, takes about 1 minute... " 5 | # dosynctodr may need to be left alone as of with Solaris 2.6 6 | # The following line is unnecessary if you turn off 7 | # dosynctodr in /etc/system. 8 | /usr/local/bin/tickadj -s 9 | /usr/local/bin/ntpdate -v server1 server2 10 | sleep 5 11 | /usr/local/bin/xntpd 12 | fi 13 | else 14 | if [ $1 = "stop" ]; then 15 | pid=`/usr/bin/ps -e | /usr/bin/grep xntpd | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'` 16 | if [ "${pid}" != "" ]; then 17 | echo "Stopping Network Time Protocol daemon " 18 | /usr/bin/kill ${pid} 19 | fi 20 | fi 21 | fi 22 | -------------------------------------------------------------------------------- /html/hints/sun4: -------------------------------------------------------------------------------- 1 | Notes on CPU clock oscillator tolerance with SunOS 4.1.1 and 4.1.3 2 | 3 | A bug in SunOS 4.1.1 results in the kernel time losing 1 microsecond 4 | per tick of the system clock. The bug was fixed (bugid 1094383) for 5 | SunOS 4.1.1 and corrected in SunOS 4.1.3. The easiest way to fix this 6 | is to replace the 4.1.1 binary clock.o with the corresponding 4.1.3 7 | binary. Without this change it is necessary to use the tickadj program 8 | included in this distribution with the -t 9999 option. 9 | 10 | The tickadj option will work in all cases except when the kernel has 11 | been modified to correct the CPU clock oscillator frequency using a 12 | 1-pps signal from a precision source. The bugfix must be installed for 13 | this wrinkle to work properly. 14 | 15 | Dave Mills (mills@udel.edu) 16 | -------------------------------------------------------------------------------- /html/hints/svr4-dell: -------------------------------------------------------------------------------- 1 | Notes on the DELL SVR4. 2 | 3 | You should use -DSETTIMEOFDAY_BROKEN. 4 | 5 | Philip.Gladstone@mail.citicorp.com 6 | 7 | (XXX But there is no checking for SETTIMEOFDAY_BROKEN in the code) 8 | 9 | -------------------------------------------------------------------------------- /html/hints/todo: -------------------------------------------------------------------------------- 1 | Ulrich Windl : 2 | Any change in a source file in the lib directory causes all files to 3 | be recompiled (because the objects are removed). Add a better rule for 4 | make to update the library. Maybe just remove "-rm -f $?". 5 | -------------------------------------------------------------------------------- /html/icons/home.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/icons/home.gif -------------------------------------------------------------------------------- /html/icons/mail2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/icons/mail2.gif -------------------------------------------------------------------------------- /html/icons/sitemap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/icons/sitemap.png -------------------------------------------------------------------------------- /html/pic/9400n.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/9400n.jpg -------------------------------------------------------------------------------- /html/pic/alice11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/alice11.gif -------------------------------------------------------------------------------- /html/pic/alice13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/alice13.gif -------------------------------------------------------------------------------- /html/pic/alice15.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/alice15.gif -------------------------------------------------------------------------------- /html/pic/alice23.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/alice23.gif -------------------------------------------------------------------------------- /html/pic/alice31.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/alice31.gif -------------------------------------------------------------------------------- /html/pic/alice32.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/alice32.gif -------------------------------------------------------------------------------- /html/pic/alice35.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/alice35.gif -------------------------------------------------------------------------------- /html/pic/alice38.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/alice38.gif -------------------------------------------------------------------------------- /html/pic/alice44.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/alice44.gif -------------------------------------------------------------------------------- /html/pic/alice47.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/alice47.gif -------------------------------------------------------------------------------- /html/pic/alice51.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/alice51.gif -------------------------------------------------------------------------------- /html/pic/alice61.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/alice61.gif -------------------------------------------------------------------------------- /html/pic/barnstable.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/barnstable.gif -------------------------------------------------------------------------------- /html/pic/beaver.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/beaver.gif -------------------------------------------------------------------------------- /html/pic/boom3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/boom3.gif -------------------------------------------------------------------------------- /html/pic/boom3a.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/boom3a.gif -------------------------------------------------------------------------------- /html/pic/boom4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/boom4.gif -------------------------------------------------------------------------------- /html/pic/broad.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/broad.gif -------------------------------------------------------------------------------- /html/pic/bustardfly.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/bustardfly.gif -------------------------------------------------------------------------------- /html/pic/c51.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/c51.jpg -------------------------------------------------------------------------------- /html/pic/description.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/description.jpg -------------------------------------------------------------------------------- /html/pic/discipline.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/discipline.gif -------------------------------------------------------------------------------- /html/pic/dogsnake.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/dogsnake.gif -------------------------------------------------------------------------------- /html/pic/driver29.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/driver29.gif -------------------------------------------------------------------------------- /html/pic/driver43_1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/driver43_1.gif -------------------------------------------------------------------------------- /html/pic/driver43_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/driver43_2.jpg -------------------------------------------------------------------------------- /html/pic/fg6021.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/fg6021.gif -------------------------------------------------------------------------------- /html/pic/fg6039.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/fg6039.jpg -------------------------------------------------------------------------------- /html/pic/fig_3_1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/fig_3_1.gif -------------------------------------------------------------------------------- /html/pic/flatheads.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/flatheads.gif -------------------------------------------------------------------------------- /html/pic/flt1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/flt1.gif -------------------------------------------------------------------------------- /html/pic/flt2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/flt2.gif -------------------------------------------------------------------------------- /html/pic/flt3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/flt3.gif -------------------------------------------------------------------------------- /html/pic/flt4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/flt4.gif -------------------------------------------------------------------------------- /html/pic/flt5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/flt5.gif -------------------------------------------------------------------------------- /html/pic/flt6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/flt6.gif -------------------------------------------------------------------------------- /html/pic/flt7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/flt7.gif -------------------------------------------------------------------------------- /html/pic/flt8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/flt8.gif -------------------------------------------------------------------------------- /html/pic/flt9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/flt9.gif -------------------------------------------------------------------------------- /html/pic/freq1211.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/freq1211.gif -------------------------------------------------------------------------------- /html/pic/gadget.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/gadget.jpg -------------------------------------------------------------------------------- /html/pic/gps167.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/gps167.jpg -------------------------------------------------------------------------------- /html/pic/group.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/group.gif -------------------------------------------------------------------------------- /html/pic/hornraba.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/hornraba.gif -------------------------------------------------------------------------------- /html/pic/igclock.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/igclock.gif -------------------------------------------------------------------------------- /html/pic/neoclock4x.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/neoclock4x.gif -------------------------------------------------------------------------------- /html/pic/offset1211.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/offset1211.gif -------------------------------------------------------------------------------- /html/pic/oncore_evalbig.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/oncore_evalbig.gif -------------------------------------------------------------------------------- /html/pic/oncore_remoteant.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/oncore_remoteant.jpg -------------------------------------------------------------------------------- /html/pic/oncore_utplusbig.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/oncore_utplusbig.gif -------------------------------------------------------------------------------- /html/pic/oz2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/oz2.gif -------------------------------------------------------------------------------- /html/pic/panda.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/panda.gif -------------------------------------------------------------------------------- /html/pic/pd_om006.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/pd_om006.gif -------------------------------------------------------------------------------- /html/pic/pd_om011.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/pd_om011.gif -------------------------------------------------------------------------------- /html/pic/peer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/peer.gif -------------------------------------------------------------------------------- /html/pic/pogo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/pogo.gif -------------------------------------------------------------------------------- /html/pic/pogo1a.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/pogo1a.gif -------------------------------------------------------------------------------- /html/pic/pogo3a.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/pogo3a.gif -------------------------------------------------------------------------------- /html/pic/pogo4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/pogo4.gif -------------------------------------------------------------------------------- /html/pic/pogo5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/pogo5.gif -------------------------------------------------------------------------------- /html/pic/pogo6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/pogo6.gif -------------------------------------------------------------------------------- /html/pic/pogo7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/pogo7.gif -------------------------------------------------------------------------------- /html/pic/pogo8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/pogo8.gif -------------------------------------------------------------------------------- /html/pic/pzf509.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/pzf509.jpg -------------------------------------------------------------------------------- /html/pic/pzf511.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/pzf511.jpg -------------------------------------------------------------------------------- /html/pic/rabbit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/rabbit.gif -------------------------------------------------------------------------------- /html/pic/radio2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/radio2.jpg -------------------------------------------------------------------------------- /html/pic/sheepb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/sheepb.jpg -------------------------------------------------------------------------------- /html/pic/stack1a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/stack1a.jpg -------------------------------------------------------------------------------- /html/pic/stats.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/stats.gif -------------------------------------------------------------------------------- /html/pic/sx5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/sx5.gif -------------------------------------------------------------------------------- /html/pic/thunderbolt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/thunderbolt.jpg -------------------------------------------------------------------------------- /html/pic/time1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/time1.gif -------------------------------------------------------------------------------- /html/pic/tonea.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/tonea.gif -------------------------------------------------------------------------------- /html/pic/tribeb.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/tribeb.gif -------------------------------------------------------------------------------- /html/pic/wingdorothy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/html/pic/wingdorothy.gif -------------------------------------------------------------------------------- /html/scripts/accopt.txt: -------------------------------------------------------------------------------- 1 | document.write("

Access Control Commands and Options

") 6 | -------------------------------------------------------------------------------- /html/scripts/audio.txt: -------------------------------------------------------------------------------- 1 | document.write("

Reference Clock Audio Drivers

") 8 | -------------------------------------------------------------------------------- /html/scripts/authopt.txt: -------------------------------------------------------------------------------- 1 | document.write("

Authentication Commands and Options

") 13 | -------------------------------------------------------------------------------- /html/scripts/clockopt.txt: -------------------------------------------------------------------------------- 1 | document.write("

Reference Clock Commands and Options

") 6 | -------------------------------------------------------------------------------- /html/scripts/command.txt: -------------------------------------------------------------------------------- 1 | document.write("\ 2 | \ 3 | \ 5 | \ 7 |
gif\ 4 | Home Pagegif\ 6 | Contacts
") 8 | -------------------------------------------------------------------------------- /html/scripts/config.txt: -------------------------------------------------------------------------------- 1 | document.write("

Client and Server Configuration

") 6 | -------------------------------------------------------------------------------- /html/scripts/confopt.txt: -------------------------------------------------------------------------------- 1 | document.write("

Server Commands and Options

") 13 | -------------------------------------------------------------------------------- /html/scripts/footer.txt: -------------------------------------------------------------------------------- 1 | document.write("\ 2 | \ 3 | \ 5 | \ 7 | \ 9 |
\ 4 | Home Page\ 6 | Site Map\ 8 | Contacts
") 10 | -------------------------------------------------------------------------------- /html/scripts/hand.txt: -------------------------------------------------------------------------------- 1 | document.write("

Handbook Pages

") 12 | -------------------------------------------------------------------------------- /html/scripts/install.txt: -------------------------------------------------------------------------------- 1 | document.write("

Build and Install

") 11 | -------------------------------------------------------------------------------- /html/scripts/misc.txt: -------------------------------------------------------------------------------- 1 | document.write("

Miscellaneous Pages

") 10 | -------------------------------------------------------------------------------- /html/scripts/monopt.txt: -------------------------------------------------------------------------------- 1 | document.write("

Monitoring Commands and Options

") 7 | -------------------------------------------------------------------------------- /html/scripts/refclock.txt: -------------------------------------------------------------------------------- 1 | document.write("

Reference Clock Support

") 8 | -------------------------------------------------------------------------------- /include/README: -------------------------------------------------------------------------------- 1 | README file for directory ./include of the NTP Version 4 distribution 2 | 3 | This directory contains the include files used by most programs in this 4 | distribution. 5 | -------------------------------------------------------------------------------- /include/audio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Header file for audio drivers 3 | */ 4 | #include "ntp_types.h" 5 | 6 | #define MAXGAIN 255 /* max codec gain */ 7 | #define MONGAIN 127 /* codec monitor gain */ 8 | 9 | /* 10 | * Function prototypes 11 | */ 12 | int audio_init (const char *, int, int); 13 | int audio_gain (int, int, int); 14 | void audio_show (void); 15 | -------------------------------------------------------------------------------- /include/declcond.h: -------------------------------------------------------------------------------- 1 | /* 2 | * declcond.h - declarations conditionalized for ntpd 3 | * 4 | * The NTP reference implementation distribution includes two distinct 5 | * declcond.h files, one in ntpd/ used only by ntpd, and another in 6 | * include/ used by libntp and utilities. This relies on the source 7 | * file's directory being ahead of include/ in the include search. 8 | * 9 | * The ntpd variant of declcond.h declares "debug" only #ifdef DEBUG, 10 | * as the --disable-debugging version of ntpd should not reference 11 | * "debug". The libntp and utilities variant always declares debug, 12 | * as it is used in those codebases even without DEBUG defined. 13 | */ 14 | #ifndef DECLCOND_H 15 | #define DECLCOND_H 16 | 17 | /* #ifdef DEBUG */ /* uncommented in ntpd/declcond.h */ 18 | extern int debug; 19 | /* #endif */ /* uncommented in ntpd/declcond.h */ 20 | 21 | #endif /* DECLCOND_H */ 22 | -------------------------------------------------------------------------------- /include/intreswork.h: -------------------------------------------------------------------------------- 1 | /* 2 | * intreswork.h -- declarations private to ntp_intres.c, ntp_worker.c. 3 | */ 4 | #ifndef INTRESWORK_H 5 | #define INTRESWORK_H 6 | 7 | #include "ntp_worker.h" 8 | 9 | #ifdef WORKER 10 | 11 | extern int blocking_getaddrinfo(blocking_child *, 12 | blocking_pipe_header *); 13 | extern int blocking_getnameinfo(blocking_child *, 14 | blocking_pipe_header *); 15 | 16 | #ifdef TEST_BLOCKING_WORKER 17 | extern void gai_test_callback(int rescode, int gai_errno, 18 | void *context, const char *name, 19 | const char *service, 20 | const struct addrinfo *hints, 21 | const struct addrinfo *ai_res); 22 | extern void gni_test_callback(int rescode, int gni_errno, 23 | sockaddr_u *psau, int flags, 24 | const char *host, 25 | const char *service, void *context); 26 | #endif /* TEST_BLOCKING_WORKER */ 27 | #endif /* WORKER */ 28 | 29 | #endif /* INTRESWORK_H */ 30 | -------------------------------------------------------------------------------- /include/isc/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL = 2 | 3 | noinst_HEADERS = \ 4 | mem.h \ 5 | $(NULL) 6 | -------------------------------------------------------------------------------- /include/lib_strbuf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * lib_strbuf.h - definitions for routines which use the common string buffers 3 | */ 4 | #ifndef LIB_STRBUF_H 5 | #define LIB_STRBUF_H 6 | 7 | #include 8 | #include /* for ZERO() */ 9 | 10 | /* 11 | * Sizes of things 12 | */ 13 | #define LIB_NUMBUF 16 14 | #define LIB_BUFLENGTH 128 15 | 16 | typedef char libbufstr[LIB_BUFLENGTH]; 17 | extern libbufstr lib_stringbuf[LIB_NUMBUF]; 18 | extern int lib_nextbuf; 19 | extern int lib_inited; 20 | 21 | 22 | /* 23 | * Macro to get a pointer to the next buffer 24 | */ 25 | #define LIB_GETBUF(bufp) \ 26 | do { \ 27 | ZERO(lib_stringbuf[lib_nextbuf]); \ 28 | (bufp) = &lib_stringbuf[lib_nextbuf++][0]; \ 29 | lib_nextbuf %= COUNTOF(lib_stringbuf); \ 30 | } while (FALSE) 31 | 32 | #endif /* LIB_STRBUF_H */ 33 | -------------------------------------------------------------------------------- /include/libntp.h: -------------------------------------------------------------------------------- 1 | /* libntp.h */ 2 | 3 | #if defined(HAVE_SYSCONF) && defined(_SC_OPEN_MAX) 4 | #define GETDTABLESIZE() ((int)sysconf(_SC_OPEN_MAX)) 5 | #elif defined(HAVE_GETDTABLESIZE) 6 | #define GETDTABLESIZE getdtablesize 7 | #else 8 | /* 9 | * if we have no idea about the max fd value set up things 10 | * so we will start at FOPEN_MAX 11 | */ 12 | #define GETDTABLESIZE() (FOPEN_MAX + FD_CHUNK) 13 | #endif 14 | 15 | extern void make_socket_nonblocking( SOCKET fd ); 16 | extern SOCKET move_fd( SOCKET fd ); 17 | -------------------------------------------------------------------------------- /include/ntp_cmdargs.h: -------------------------------------------------------------------------------- 1 | extern void getCmdOpts(int, char **); 2 | -------------------------------------------------------------------------------- /include/ntp_debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Header$ 3 | * 4 | * $Created: Sat Aug 20 14:23:01 2005 $ 5 | * 6 | * Copyright (C) 2005 by Frank Kardel 7 | */ 8 | #ifndef NTP_DEBUG_H 9 | #define NTP_DEBUG_H 10 | 11 | /* 12 | * macro for debugging output - cut down on #ifdef pollution. 13 | * 14 | * TRACE() is similar to ntpd's DPRINTF() for utilities and libntp. 15 | * Uses mprintf() and so supports %m, replaced by strerror(errno). 16 | * 17 | * The calling convention is not attractive: 18 | * TRACE(debuglevel, (fmt, ...)); 19 | * TRACE(2, ("this will appear on stdout if debug >= %d\n", 2)); 20 | */ 21 | #define TRACE(lvl, arg) \ 22 | do { \ 23 | if (debug >= (lvl)) \ 24 | mprintf arg; \ 25 | } while (0) 26 | 27 | #endif /* NTP_DEBUG_H */ 28 | -------------------------------------------------------------------------------- /include/ntp_if.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Sockets are not standard. 3 | * So hide uglyness in include file. 4 | */ 5 | /* was: defined(SYS_CONVEXOS9) */ 6 | #if defined(HAVE__SYS_SYNC_QUEUE_H) && defined(HAVE__SYS_SYNC_SEMA_H) 7 | # include "/sys/sync/queue.h" 8 | # include "/sys/sync/sema.h" 9 | #endif 10 | 11 | /* was: (defined(SYS_SOLARIS) && !defined(bsd)) || defined(SYS_SUNOS4) */ 12 | /* was: defined(SYS_UNIXWARE1) */ 13 | #ifdef HAVE_SYS_SOCKIO_H 14 | # include 15 | #endif 16 | 17 | /* was: #if defined(SYS_PTX) || defined(SYS_SINIXM) */ 18 | #ifdef HAVE_SYS_STREAM_H 19 | # include 20 | #endif 21 | #ifdef HAVE_SYS_STROPTS_H 22 | # include 23 | #endif 24 | 25 | #ifdef HAVE_NET_IF_H 26 | # include 27 | #endif /* HAVE_NET_IF_H */ 28 | -------------------------------------------------------------------------------- /include/ntp_keyacc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ntp_keyacc.h - key access stuff 3 | */ 4 | #ifndef NTP_KEYACC_H 5 | #define NTP_KEYACC_H 6 | 7 | typedef struct keyaccess KeyAccT; 8 | struct keyaccess { 9 | KeyAccT * next; 10 | sockaddr_u addr; 11 | }; 12 | 13 | #endif /* NTP_KEYACC_H */ 14 | -------------------------------------------------------------------------------- /include/ntp_libopts.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ntp_libopts.h 3 | * 4 | * Common code interfacing with Autogen's libopts command-line option 5 | * processing. 6 | */ 7 | #ifndef NTP_LIBOPTS_H 8 | # define NTP_LIBOPTS_H 9 | # include "autoopts/options.h" 10 | 11 | extern int ntpOptionProcess(tOptions *pOpts, int argc, 12 | char ** argv); 13 | extern void ntpOptionPrintVersion(tOptions *, tOptDesc *); 14 | #endif 15 | -------------------------------------------------------------------------------- /include/ntp_lineedit.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * ntp_lineedit.h - generic interface to various line editing libs 4 | */ 5 | 6 | int ntp_readline_init(const char *prompt); 7 | void ntp_readline_uninit(void); 8 | 9 | /* 10 | * strings returned by ntp_readline go home to free() 11 | */ 12 | char * ntp_readline(int *pcount); 13 | 14 | -------------------------------------------------------------------------------- /include/ntp_proto.h: -------------------------------------------------------------------------------- 1 | #ifndef NTP_PROTO_H 2 | #define NTP_PROTO_H 3 | 4 | #define NTP_MAXFREQ 500e-6 5 | 6 | #endif /* NTP_PROTO_H */ 7 | -------------------------------------------------------------------------------- /include/ntp_random.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | void ntp_crypto_srandom(void); 5 | int ntp_crypto_random_buf(void *buf, size_t nbytes); 6 | 7 | long ntp_random (void); 8 | void ntp_srandom (unsigned long); 9 | void ntp_srandomdev (void); 10 | char * ntp_initstate (unsigned long, /* seed for R.N.G. */ 11 | char *, /* pointer to state array */ 12 | long /* # bytes of state info */ 13 | ); 14 | char * ntp_setstate (char *); /* pointer to state array */ 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /include/ntp_select.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Not all machines define FD_SET in sys/types.h 3 | */ 4 | #ifndef NTP_SELECT_H 5 | #define NTP_SELECT_H /* note: tested by include/l_stdlib.h */ 6 | 7 | /* Was: (defined(RS6000)||defined(SYS_PTX))&&!defined(_BSD) */ 8 | /* Could say: !defined(FD_SET) && defined(HAVE_SYS_SELECT_H) */ 9 | /* except FD_SET can legitimately be a typedef... */ 10 | #if defined(HAVE_SYS_SELECT_H) && !defined(_BSD) 11 | # ifndef SYS_VXWORKS 12 | # include 13 | # else 14 | # include 15 | extern int select(int width, fd_set *pReadFds, fd_set *pWriteFds, 16 | fd_set *pExceptFds, struct timeval *pTimeOut); 17 | # endif 18 | #endif 19 | 20 | #if !defined(FD_SET) 21 | # define NFDBITS 32 22 | # define FD_SETSIZE 32 23 | # define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) 24 | # define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) 25 | # define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) 26 | # define FD_ZERO(p) memset((p), 0, sizeof(*(p))) 27 | #endif 28 | 29 | #if defined(VMS) 30 | typedef struct { 31 | unsigned int fds_bits[1]; 32 | } fd_set; 33 | #endif 34 | 35 | #endif /* NTP_SELECT_H */ 36 | -------------------------------------------------------------------------------- /include/ntp_string.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Define string ops: strchr strrchr memcmp memmove memset 3 | */ 4 | 5 | #ifndef NTP_STRING_H 6 | #define NTP_STRING_H 7 | 8 | #ifdef HAVE_MEMORY_H 9 | # include 10 | #endif 11 | 12 | #ifdef HAVE_STRING_H 13 | # include 14 | #endif 15 | 16 | #ifdef HAVE_BSTRING_H 17 | # include 18 | #endif 19 | 20 | #ifdef NTP_NEED_BOPS 21 | 22 | #ifdef HAVE_STRINGS_H 23 | # include /* bcmp, bcopy, bzero */ 24 | #endif 25 | 26 | void ntp_memset (char *, int, int); 27 | 28 | #define memcmp(a, b, c) bcmp(a, b, (int)(c)) 29 | #define memmove(t, f, c) bcopy(f, t, (int)(c)) 30 | #define memcpy(t, f, c) bcopy(f, t, (int)(c)) 31 | #define memset(a, x, c) if (0 == (x)) \ 32 | bzero(a, (int)(c)); \ 33 | else \ 34 | ntp_memset((char *)(a), x, c) 35 | #endif /* NTP_NEED_BOPS */ 36 | 37 | #endif /* NTP_STRING_H */ 38 | -------------------------------------------------------------------------------- /include/ntp_workimpl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ntp_workimpl.h - selects worker child implementation 3 | */ 4 | #ifndef NTP_WORKIMPL_H 5 | #define NTP_WORKIMPL_H 6 | 7 | /* 8 | * Some systems do not support fork() and don't have an alternate 9 | * threads implementation of ntp_intres. Such systems are limited 10 | * to using numeric IP addresses. 11 | */ 12 | #if defined(SYS_WINNT) 13 | # define WORK_THREAD 14 | #elif defined(ISC_PLATFORM_USETHREADS) && \ 15 | defined(HAVE_SEM_TIMEDWAIT) && \ 16 | (defined(HAVE_GETCLOCK) || defined(HAVE_CLOCK_GETTIME)) 17 | # define WORK_THREAD 18 | # define WORK_PIPE 19 | #elif defined(VMS) || defined(SYS_VXWORKS) 20 | /* empty */ 21 | #elif defined(HAVE_WORKING_FORK) 22 | # define WORK_FORK 23 | # define WORK_PIPE 24 | #endif 25 | 26 | #if defined(WORK_FORK) || defined(WORK_THREAD) 27 | # define WORKER 28 | #endif 29 | 30 | #endif /* !NTP_WORKIMPL_H */ 31 | -------------------------------------------------------------------------------- /include/rc_cmdlength.h: -------------------------------------------------------------------------------- 1 | 2 | extern size_t remoteconfig_cmdlength( const char *src_buf, const char *src_end ); 3 | -------------------------------------------------------------------------------- /include/refclock_atom.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Definitions for the atom driver and its friends 3 | */ 4 | #undef NANOSECOND /* some systems define it differently */ 5 | #define NANOSECOND 1000000000 /* one second (ns) */ 6 | 7 | struct refclock_atom { 8 | pps_handle_t handle; 9 | pps_params_t pps_params; 10 | struct timespec ts; 11 | }; 12 | 13 | extern int refclock_ppsapi(int, struct refclock_atom *); 14 | extern int refclock_params(int, struct refclock_atom *); 15 | extern int refclock_pps(struct peer *, struct refclock_atom *, int); 16 | -------------------------------------------------------------------------------- /include/refidsmear.h: -------------------------------------------------------------------------------- 1 | 2 | extern l_fp convertRefIDToLFP(uint32_t r); 3 | extern uint32_t convertLFPToRefID(l_fp num); 4 | -------------------------------------------------------------------------------- /include/vint64ops.h: -------------------------------------------------------------------------------- 1 | /* 2 | * vint64ops.h - operations on 'vint64' values 3 | * 4 | * Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project. 5 | * The contents of 'html/copyright.html' apply. 6 | * ---------------------------------------------------------------------- 7 | * This is an attempt to get the vint64 calculations stuff centralised. 8 | */ 9 | #ifndef VINT64OPS_H 10 | #define VINT64OPS_H 11 | 12 | /* signed/unsigned compare. returns 1/0/-1 if lhs >/=/< rhs */ 13 | extern int icmpv64(const vint64 * lhs, const vint64 * rhs); 14 | extern int ucmpv64(const vint64 * lhs, const vint64 * rhs); 15 | 16 | /* add / subtract */ 17 | extern vint64 addv64(const vint64 *lhs, const vint64 *rhs); 18 | extern vint64 addv64i32(const vint64 * lhs, int32_t rhs); 19 | extern vint64 addv64u32(const vint64 * lhs, uint32_t rhs); 20 | 21 | extern vint64 subv64(const vint64 *lhs, const vint64 *rhs); 22 | extern vint64 subv64i32(const vint64 * lhs, int32_t rhs); 23 | extern vint64 subv64u32(const vint64 * lhs, uint32_t rhs); 24 | 25 | /* parsing. works like strtoul() or strtoull() */ 26 | extern vint64 strtouv64(const char * begp, char ** endp, int base); 27 | 28 | #endif /*!defined(VINT64OPS_H)*/ 29 | -------------------------------------------------------------------------------- /includes.mf: -------------------------------------------------------------------------------- 1 | ## includes.mf - automake fragment 2 | 3 | NTP_INCS = -I$(top_srcdir)/include 4 | NTP_INCS += -I$(top_srcdir)/lib/isc/include 5 | NTP_INCS += -I$(top_srcdir)/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include 6 | NTP_INCS += -I$(top_srcdir)/lib/isc/unix/include 7 | -------------------------------------------------------------------------------- /kernel/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = sys 2 | -------------------------------------------------------------------------------- /kernel/sys/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_HEADERS = bsd_audioirig.h i8253.h parsestreams.h \ 2 | pcl720.h ppsclock.h timex.h tpro.h tt560_api.h 3 | -------------------------------------------------------------------------------- /kernel/sys/README: -------------------------------------------------------------------------------- 1 | README file for directory ./kernel/sys of the NTP Version 3 distribution 2 | 3 | This directory contains system header files used by the clock discipline 4 | and STREAMS modules in the .. (./kernel) directory. 5 | 6 | If the precision-time kernel (KERNEL_PLL define) is configured, the 7 | installation process requires the header file /usr/include/sys/timex.h 8 | for the particular architecture to be in place. The file timex.h included 9 | in this distribution is for Suns; the files for other systems can be 10 | found in the kernel distributions available from the manufacturer's 11 | representatives. 12 | -------------------------------------------------------------------------------- /lib/isc/Atffile: -------------------------------------------------------------------------------- 1 | Content-Type: application/X-atf-atffile; version="1" 2 | 3 | prop: test-suite = bind9 4 | 5 | tp: tests 6 | -------------------------------------------------------------------------------- /lib/isc/api: -------------------------------------------------------------------------------- 1 | # LIBINTERFACE ranges 2 | # 9.6: 50-59, 110-119 3 | # 9.7: 60-79 4 | # 9.8: 80-89 5 | # 9.9: 90-109 6 | LIBINTERFACE = 91 7 | LIBREVISION = 1 8 | LIBAGE = 1 9 | -------------------------------------------------------------------------------- /lib/isc/noatomic/include/isc/atomic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005, 2007 Internet Systems Consortium, Inc. ("ISC") 3 | * 4 | * Permission to use, copy, modify, and/or distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 9 | * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 10 | * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 11 | * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 12 | * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 13 | * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 14 | * PERFORMANCE OF THIS SOFTWARE. 15 | */ 16 | 17 | /* $Id: atomic.h,v 1.4 2007/06/19 23:47:18 tbox Exp $ */ 18 | 19 | #ifndef ISC_ATOMIC_H 20 | #define ISC_ATOMIC_H 1 21 | 22 | /* This file is inherently empty. */ 23 | 24 | #endif /* ISC_ATOMIC_H */ 25 | -------------------------------------------------------------------------------- /lib/isc/nothreads/condition.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2004, 2006, 2007 Internet Systems Consortium, Inc. ("ISC") 3 | * Copyright (C) 2000, 2001 Internet Software Consortium. 4 | * 5 | * Permission to use, copy, modify, and/or distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 10 | * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 11 | * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 | * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 14 | * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 | * PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | /* $Id: condition.c,v 1.10 2007/06/19 23:47:18 tbox Exp $ */ 19 | 20 | #include 21 | 22 | #include 23 | 24 | EMPTY_TRANSLATION_UNIT 25 | -------------------------------------------------------------------------------- /lib/isc/nothreads/mutex.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2004, 2006, 2007 Internet Systems Consortium, Inc. ("ISC") 3 | * Copyright (C) 2000, 2001 Internet Software Consortium. 4 | * 5 | * Permission to use, copy, modify, and/or distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 10 | * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 11 | * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 | * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 14 | * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 | * PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | /* $Id: mutex.c,v 1.10 2007/06/19 23:47:18 tbox Exp $ */ 19 | 20 | #include 21 | 22 | #include 23 | 24 | EMPTY_TRANSLATION_UNIT 25 | 26 | -------------------------------------------------------------------------------- /lib/isc/nothreads/thread.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") 3 | * Copyright (C) 2000, 2001 Internet Software Consortium. 4 | * 5 | * Permission to use, copy, modify, and/or distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 10 | * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 11 | * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 | * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 14 | * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 | * PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | /* $Id: thread.c,v 1.5 2007/06/19 23:47:18 tbox Exp $ */ 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | void 26 | isc_thread_setconcurrency(unsigned int level) { 27 | UNUSED(level); 28 | } 29 | -------------------------------------------------------------------------------- /lib/isc/tests/Atffile: -------------------------------------------------------------------------------- 1 | Content-Type: application/X-atf-atffile; version="1" 2 | 3 | prop: test-suite = bind9 4 | 5 | tp-glob: *_test 6 | -------------------------------------------------------------------------------- /lib/isc/unix/ipv6.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") 3 | * Copyright (C) 1999-2001 Internet Software Consortium. 4 | * 5 | * Permission to use, copy, modify, and/or distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 10 | * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 11 | * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 | * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 14 | * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 | * PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | /* $Id: ipv6.c,v 1.14 2007/06/19 23:47:18 tbox Exp $ */ 19 | 20 | /*! \file */ 21 | 22 | #include 23 | 24 | #include 25 | 26 | const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; 27 | const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; 28 | -------------------------------------------------------------------------------- /lib/isc/win32/libgen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC") 3 | * 4 | * Permission to use, copy, modify, and/or distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 9 | * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 10 | * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 11 | * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 12 | * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 13 | * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 14 | * PERFORMANCE OF THIS SOFTWARE. 15 | */ 16 | 17 | /* $Id: libgen.h,v 1.3 2009/07/17 23:47:41 tbox Exp $ */ 18 | 19 | #ifndef LIBGEN_H 20 | #define LIBGEN_H 1 21 | 22 | char *basename(const char *); 23 | char *dirname(const char *); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /lib/isc/win32/libisc.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "libisc"=".\libisc.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /libjsmn/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Serge A. Zaitsev 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /libjsmn/Makefile: -------------------------------------------------------------------------------- 1 | # You can put your build options here 2 | -include config.mk 3 | 4 | all: libjsmn.a 5 | 6 | libjsmn.a: jsmn.o 7 | $(AR) rc $@ $^ 8 | 9 | %.o: %.c jsmn.h 10 | $(CC) -c $(CFLAGS) $< -o $@ 11 | 12 | test: jsmn_test 13 | ./jsmn_test 14 | 15 | jsmn_test: jsmn_test.o 16 | $(CC) $(LDFLAGS) -L. -ljsmn $< -o $@ 17 | 18 | jsmn_test.o: jsmn_test.c libjsmn.a 19 | 20 | simple_example: example/simple.o libjsmn.a 21 | $(CC) $(LDFLAGS) $^ -o $@ 22 | 23 | jsondump: example/jsondump.o libjsmn.a 24 | $(CC) $(LDFLAGS) $^ -o $@ 25 | 26 | clean: 27 | rm -f jsmn.o jsmn_test.o example/simple.o 28 | rm -f jsmn_test 29 | rm -f jsmn_test.exe 30 | rm -f libjsmn.a 31 | rm -f simple_example 32 | rm -f jsondump 33 | 34 | .PHONY: all clean test 35 | 36 | -------------------------------------------------------------------------------- /libntp/README: -------------------------------------------------------------------------------- 1 | README file for directory ./libntp of the NTP Version 4 distribution 2 | 3 | This directory contains the sources for the NTP library used by most 4 | programs in this distribution. See the README and RELNOTES files in the 5 | parent directory for directions on how to make this library. 6 | -------------------------------------------------------------------------------- /libntp/adjtimex.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1983 Regents of the University of California. 3 | * All rights reserved. The Berkeley software License Agreement 4 | * specifies the terms and conditions for redistribution. 5 | */ 6 | 7 | #ifndef lint 8 | _sccsid:.asciz "11/19/91 ULTRIX @(#)adjtime.c 6.1" 9 | #endif not lint 10 | 11 | #include "SYS.h" 12 | 13 | SYSCALL(adjtimex) 14 | ret 15 | 16 | -------------------------------------------------------------------------------- /libntp/atoint.c: -------------------------------------------------------------------------------- 1 | /* 2 | * atoint - convert an ascii string to a signed long, with error checking 3 | */ 4 | #include 5 | #include 6 | #include 7 | 8 | #include "ntp_types.h" 9 | #include "ntp_stdlib.h" 10 | 11 | int 12 | atoint( 13 | const char *str, 14 | long *ival 15 | ) 16 | { 17 | register long u; 18 | register const char *cp; 19 | register int isneg; 20 | register int oflow_digit; 21 | 22 | cp = str; 23 | 24 | if (*cp == '-') { 25 | cp++; 26 | isneg = 1; 27 | oflow_digit = '8'; 28 | } else { 29 | isneg = 0; 30 | oflow_digit = '7'; 31 | } 32 | 33 | if (*cp == '\0') 34 | return 0; 35 | 36 | u = 0; 37 | while (*cp != '\0') { 38 | if (!isdigit((unsigned char)*cp)) 39 | return 0; 40 | if (u > 214748364 || (u == 214748364 && *cp > oflow_digit)) 41 | return 0; /* overflow */ 42 | u = (u << 3) + (u << 1); 43 | u += *cp++ - '0'; /* ascii dependent */ 44 | } 45 | 46 | if (isneg) 47 | *ival = -u; 48 | else 49 | *ival = u; 50 | return 1; 51 | } 52 | -------------------------------------------------------------------------------- /libntp/atouint.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "ntp_types.h" 6 | #include "ntp_stdlib.h" 7 | 8 | /* 9 | * atouint() - convert an ascii string representing a whole base 10 10 | * number to u_long *uval, returning TRUE if successful. 11 | * Does not modify *uval and returns FALSE if str is not 12 | * a positive base10 integer or is too large for a u_int32. 13 | * this function uses u_long but should use u_int32, and 14 | * probably be renamed. 15 | */ 16 | int 17 | atouint( 18 | const char *str, 19 | u_long *uval 20 | ) 21 | { 22 | u_long u; 23 | const char *cp; 24 | 25 | cp = str; 26 | if ('\0' == *cp) 27 | return 0; 28 | 29 | u = 0; 30 | while ('\0' != *cp) { 31 | if (!isdigit((unsigned char)*cp)) 32 | return 0; 33 | if (u > 429496729 || (u == 429496729 && *cp >= '6')) 34 | return 0; /* overflow */ 35 | /* hand-optimized u *= 10; */ 36 | u = (u << 3) + (u << 1); 37 | u += *cp++ - '0'; /* not '\0' */ 38 | } 39 | 40 | *uval = u; 41 | return 1; 42 | } 43 | -------------------------------------------------------------------------------- /libntp/authusekey.c: -------------------------------------------------------------------------------- 1 | /* 2 | * authusekey - decode a key from ascii and use it 3 | */ 4 | #include 5 | #include 6 | #include 7 | 8 | #include "ntp_types.h" 9 | #include "ntp_string.h" 10 | #include "ntp_stdlib.h" 11 | 12 | /* 13 | * Types of ascii representations for keys. "Standard" means a 64 bit 14 | * hex number in NBS format, i.e. with the low order bit of each byte 15 | * a parity bit. "NTP" means a 64 bit key in NTP format, with the 16 | * high order bit of each byte a parity bit. "Ascii" means a 1-to-8 17 | * character string whose ascii representation is used as the key. 18 | */ 19 | int 20 | authusekey( 21 | keyid_t keyno, 22 | int keytype, 23 | const u_char *str 24 | ) 25 | { 26 | size_t len; 27 | 28 | len = strlen((const char *)str); 29 | if (0 == len) 30 | return 0; 31 | 32 | MD5auth_setkey(keyno, keytype, str, len, NULL); 33 | return 1; 34 | } 35 | -------------------------------------------------------------------------------- /libntp/buftvtots.c: -------------------------------------------------------------------------------- 1 | /* 2 | * buftvtots - pull a Unix-format (struct timeval) time stamp out of 3 | * an octet stream and convert it to a l_fp time stamp. 4 | * This is useful when using the clock line discipline. 5 | */ 6 | 7 | #ifdef HAVE_CONFIG_H 8 | #include "config.h" 9 | #endif 10 | #include "ntp_fp.h" 11 | #include "ntp_string.h" 12 | #include "timevalops.h" 13 | 14 | #ifndef SYS_WINNT 15 | int 16 | buftvtots( 17 | const char *bufp, 18 | l_fp *ts 19 | ) 20 | { 21 | struct timeval tv; 22 | 23 | /* 24 | * copy to adhere to alignment restrictions 25 | */ 26 | memcpy(&tv, bufp, sizeof(tv)); 27 | 28 | /* 29 | * and use it 30 | */ 31 | if (tv.tv_usec > MICROSECONDS - 1) 32 | return FALSE; 33 | 34 | *ts = tval_stamp_to_lfp(tv); 35 | 36 | return TRUE; 37 | } 38 | #endif /* !SYS_WINNT */ 39 | -------------------------------------------------------------------------------- /libntp/caljulian.c: -------------------------------------------------------------------------------- 1 | /* 2 | * caljulian - determine the Julian date from an NTP time. 3 | * 4 | * (Note: since we use the GREGORIAN calendar, this should be renamed to 5 | * 'calgregorian' eventually...) 6 | */ 7 | #include 8 | #include 9 | 10 | #include "ntp_types.h" 11 | #include "ntp_calendar.h" 12 | 13 | #if !(defined(ISC_CHECK_ALL) || defined(ISC_CHECK_NONE) || \ 14 | defined(ISC_CHECK_ENSURE) || defined(ISC_CHECK_INSIST) || \ 15 | defined(ISC_CHECK_INVARIANT)) 16 | # define ISC_CHECK_ALL 17 | #endif 18 | 19 | #include "ntp_assert.h" 20 | 21 | void 22 | caljulian( 23 | uint32_t ntp, 24 | struct calendar * jt 25 | ) 26 | { 27 | vint64 vlong; 28 | ntpcal_split split; 29 | 30 | 31 | INSIST(NULL != jt); 32 | 33 | /* 34 | * Unfold ntp time around current time into NTP domain. Split 35 | * into days and seconds, shift days into CE domain and 36 | * process the parts. 37 | */ 38 | vlong = ntpcal_ntp_to_ntp(ntp, NULL); 39 | split = ntpcal_daysplit(&vlong); 40 | ntpcal_daysplit_to_date(jt, &split, DAY_NTP_STARTS); 41 | } 42 | -------------------------------------------------------------------------------- /libntp/hextoint.c: -------------------------------------------------------------------------------- 1 | /* 2 | * hextoint - convert an ascii string in hex to an unsigned 3 | * long, with error checking 4 | */ 5 | #include 6 | #include 7 | 8 | #include "ntp_stdlib.h" 9 | 10 | int 11 | hextoint( 12 | const char *str, 13 | u_long *pu 14 | ) 15 | { 16 | register u_long u; 17 | register const char *cp; 18 | 19 | cp = str; 20 | 21 | if (*cp == '\0') 22 | return 0; 23 | 24 | u = 0; 25 | while (*cp != '\0') { 26 | if (!isxdigit((unsigned char)*cp)) 27 | return 0; 28 | if (u & 0xF0000000) 29 | return 0; /* overflow */ 30 | u <<= 4; 31 | if ('0' <= *cp && *cp <= '9') 32 | u += *cp++ - '0'; 33 | else if ('a' <= *cp && *cp <= 'f') 34 | u += *cp++ - 'a' + 10; 35 | else if ('A' <= *cp && *cp <= 'F') 36 | u += *cp++ - 'A' + 10; 37 | else 38 | return 0; 39 | } 40 | *pu = u; 41 | return 1; 42 | } 43 | -------------------------------------------------------------------------------- /libntp/lib_strbuf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * lib_strbuf - library string storage 3 | */ 4 | #ifdef HAVE_CONFIG_H 5 | #include 6 | #endif 7 | 8 | #include 9 | #include 10 | 11 | #include "ntp_fp.h" 12 | #include "ntp_stdlib.h" 13 | #include "lib_strbuf.h" 14 | 15 | 16 | /* 17 | * Storage declarations 18 | */ 19 | int debug; 20 | libbufstr lib_stringbuf[LIB_NUMBUF]; 21 | int lib_nextbuf; 22 | int ipv4_works; 23 | int ipv6_works; 24 | int lib_inited; 25 | 26 | 27 | /* 28 | * initialization routine. Might be needed if the code is ROMized. 29 | */ 30 | void 31 | init_lib(void) 32 | { 33 | if (lib_inited) 34 | return; 35 | ipv4_works = (ISC_R_SUCCESS == isc_net_probeipv4()); 36 | ipv6_works = (ISC_R_SUCCESS == isc_net_probeipv6()); 37 | init_systime(); 38 | lib_inited = TRUE; 39 | } 40 | -------------------------------------------------------------------------------- /libntp/modetoa.c: -------------------------------------------------------------------------------- 1 | /* 2 | * modetoa - return an asciized mode 3 | */ 4 | #include 5 | #include 6 | 7 | #include "lib_strbuf.h" 8 | #include "ntp_stdlib.h" 9 | 10 | const char * 11 | modetoa( 12 | size_t mode 13 | ) 14 | { 15 | char *bp; 16 | static const char * const modestrings[] = { 17 | "unspec", 18 | "sym_active", 19 | "sym_passive", 20 | "client", 21 | "server", 22 | "broadcast", 23 | "control", 24 | "private", 25 | "bclient", 26 | }; 27 | 28 | if (mode >= COUNTOF(modestrings)) { 29 | LIB_GETBUF(bp); 30 | snprintf(bp, LIB_BUFLENGTH, "mode#%zu", mode); 31 | return bp; 32 | } 33 | 34 | return modestrings[mode]; 35 | } 36 | -------------------------------------------------------------------------------- /libntp/numtohost.c: -------------------------------------------------------------------------------- 1 | /* 2 | * numtohost - convert network number to host name. 3 | */ 4 | #include 5 | 6 | #include 7 | #ifdef HAVE_NETINET_IN_H 8 | #include /* ntohl */ 9 | #endif 10 | 11 | #include "ntp_fp.h" 12 | #include "ntp_stdlib.h" 13 | #include "lib_strbuf.h" 14 | 15 | #define LOOPBACKNET 0x7f000000 16 | #define LOOPBACKHOST 0x7f000001 17 | #define LOOPBACKNETMASK 0xff000000 18 | 19 | char * 20 | numtohost( 21 | u_int32 netnum 22 | ) 23 | { 24 | char *bp; 25 | struct hostent *hp; 26 | 27 | /* 28 | * This is really gross, but saves lots of hanging looking for 29 | * hostnames for the radio clocks. Don't bother looking up 30 | * addresses on the loopback network except for the loopback 31 | * host itself. 32 | */ 33 | if ((((ntohl(netnum) & LOOPBACKNETMASK) == LOOPBACKNET) 34 | && (ntohl(netnum) != LOOPBACKHOST)) 35 | || ((hp = gethostbyaddr((char *)&netnum, sizeof netnum, AF_INET)) 36 | == 0)) 37 | return numtoa(netnum); 38 | 39 | LIB_GETBUF(bp); 40 | strlcpy(bp, hp->h_name, LIB_BUFLENGTH); 41 | 42 | return bp; 43 | } 44 | -------------------------------------------------------------------------------- /libntp/octtoint.c: -------------------------------------------------------------------------------- 1 | /* 2 | * octtoint - convert an ascii string in octal to an unsigned 3 | * long, with error checking 4 | */ 5 | #include 6 | #include 7 | #include 8 | 9 | #include "ntp_stdlib.h" 10 | 11 | int 12 | octtoint( 13 | const char *str, 14 | u_long *ival 15 | ) 16 | { 17 | register u_long u; 18 | register const char *cp; 19 | 20 | cp = str; 21 | 22 | if (*cp == '\0') 23 | return 0; 24 | 25 | u = 0; 26 | while (*cp != '\0') { 27 | if (!isdigit((unsigned char)*cp) || *cp == '8' || *cp == '9') 28 | return 0; 29 | if (u >= 0x20000000) 30 | return 0; /* overflow */ 31 | u <<= 3; 32 | u += *cp++ - '0'; /* ascii dependent */ 33 | } 34 | *ival = u; 35 | return 1; 36 | } 37 | -------------------------------------------------------------------------------- /libntp/refnumtoa.c: -------------------------------------------------------------------------------- 1 | /* 2 | * refnumtoa - return asciized refclock addresses stored in local array space 3 | */ 4 | #include 5 | #include 6 | 7 | #include "ntp_net.h" 8 | #include "lib_strbuf.h" 9 | #include "ntp_stdlib.h" 10 | 11 | const char * 12 | refnumtoa( 13 | sockaddr_u *num 14 | ) 15 | { 16 | u_int32 netnum; 17 | char *buf; 18 | const char *rclock; 19 | 20 | if (!ISREFCLOCKADR(num)) 21 | return socktoa(num); 22 | 23 | LIB_GETBUF(buf); 24 | netnum = SRCADR(num); 25 | rclock = clockname((int)((u_long)netnum >> 8) & 0xff); 26 | 27 | if (rclock != NULL) 28 | snprintf(buf, LIB_BUFLENGTH, "%s(%lu)", 29 | rclock, (u_long)netnum & 0xff); 30 | else 31 | snprintf(buf, LIB_BUFLENGTH, "REFCLK(%lu,%lu)", 32 | ((u_long)netnum >> 8) & 0xff, 33 | (u_long)netnum & 0xff); 34 | 35 | return buf; 36 | } 37 | -------------------------------------------------------------------------------- /libntp/strdup.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include "ntp_malloc.h" 5 | #include 6 | 7 | #ifndef HAVE_STRDUP 8 | 9 | char *strdup(const char *s); 10 | 11 | char * 12 | strdup( 13 | const char *s 14 | ) 15 | { 16 | size_t octets; 17 | char * cp; 18 | 19 | REQUIRE(s); 20 | octets = strlen(s) + 1; 21 | if ((cp = malloc(octets)) == NULL) 22 | return NULL; 23 | memcpy(cp, s, octets); 24 | 25 | return cp; 26 | } 27 | #else 28 | int strdup_c_nonempty_compilation_unit; 29 | #endif 30 | -------------------------------------------------------------------------------- /libntp/systime_s.c: -------------------------------------------------------------------------------- 1 | #define SIM 2 | #include "systime.c" 3 | -------------------------------------------------------------------------------- /libntp/uglydate.c: -------------------------------------------------------------------------------- 1 | /* 2 | * uglydate - convert a time stamp to something barely readable 3 | * The string returned is 37 characters long. 4 | */ 5 | #include 6 | #include 7 | 8 | #include "ntp_fp.h" 9 | #include "ntp_unixtime.h" 10 | #include "lib_strbuf.h" 11 | #include "ntp_stdlib.h" 12 | 13 | 14 | char * 15 | uglydate( 16 | l_fp *ts 17 | ) 18 | { 19 | char *bp; 20 | char *timep; 21 | struct tm *tm; 22 | time_t sec; 23 | long msec; 24 | int year; 25 | 26 | timep = ulfptoa(ts, 6); /* returns max 17 characters */ 27 | LIB_GETBUF(bp); 28 | sec = ts->l_ui - JAN_1970; 29 | msec = ts->l_uf / 4294967; /* fract / (2**32/1000) */ 30 | tm = gmtime(&sec); 31 | if (ts->l_ui == 0) { 32 | /* 33 | * Probably not a real good thing to do. Oh, well. 34 | */ 35 | year = 0; 36 | tm->tm_yday = 0; 37 | tm->tm_hour = 0; 38 | tm->tm_min = 0; 39 | tm->tm_sec = 0; 40 | } else { 41 | year = tm->tm_year; 42 | while (year >= 100) 43 | year -= 100; 44 | } 45 | snprintf(bp, LIB_BUFLENGTH, 46 | "%17s %02d:%03d:%02d:%02d:%02d.%03ld", timep, year, 47 | tm->tm_yday, tm->tm_hour, tm->tm_min, tm->tm_sec, 48 | msec); 49 | 50 | return bp; 51 | } 52 | -------------------------------------------------------------------------------- /libntp/ymd2yd.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ymd2yd - compute the date in the year from y/m/d 3 | * 4 | * A thin wrapper around a more general calendar function. 5 | */ 6 | 7 | #include 8 | #include "ntp_stdlib.h" 9 | #include "ntp_calendar.h" 10 | 11 | int 12 | ymd2yd( 13 | int y, 14 | int m, 15 | int d) 16 | { 17 | /* 18 | * convert y/m/d to elapsed calendar units, convert that to 19 | * elapsed days since the start of the given year and convert 20 | * back to unity-based day in year. 21 | * 22 | * This does no further error checking, since the underlying 23 | * function is assumed to work out how to handle the data. 24 | */ 25 | return ntpcal_edate_to_yeardays(y-1, m-1, d-1) + 1; 26 | } 27 | -------------------------------------------------------------------------------- /libparse/mkinfo_rcmd.sed: -------------------------------------------------------------------------------- 1 | 1i\ 2 | \ 3 | \ 4 | cmd_info_t trimble_rcmds[] = { 5 | s!^#define[ \ ][ \ ]*\(CMD_R[^ \ ]*\)[ \ ][ \ ]*\([^ \ ]*\)[ \ ][ \ ]*/\*[ \ ][ \ ]*\(.*\)[ \ ]*:\([^:]*\):\([^:]*\)[ \ ][ \ ]*\*/!\ { \1, "\1", "\3 (\2)", "\4", \5 },!p 6 | $a\ 7 | \ { 0xFF, "", "", "", 0 }\ 8 | }; 9 | -------------------------------------------------------------------------------- /libparse/mkinfo_scmd.sed: -------------------------------------------------------------------------------- 1 | 1i\ 2 | /*\ 3 | \ * Automatically generated - do not modify\ 4 | \ */\ 5 | \ 6 | #include \ 7 | #include "ntp_types.h"\ 8 | #include "ntpd.h"\ 9 | #include "trimble.h"\ 10 | \ 11 | cmd_info_t trimble_scmds[] = { 12 | s!^#define[ ][ ]*\(CMD_C[^ ]*\)[ ][ ]*\([^ ]*\)[ ][ ]*/\*[ ][ ]*\(.*\)[ ][ ]*\*/! { \1, "\1", "\3 (\2)", "", 0 },!p 13 | $a\ 14 | \ { 0xFF, "", "", "", 0 }\ 15 | }; 16 | -------------------------------------------------------------------------------- /ntpd/declcond.h: -------------------------------------------------------------------------------- 1 | /* 2 | * declcond.h - declarations conditionalized for ntpd 3 | * 4 | * The NTP reference implementation distribution includes two distinct 5 | * declcond.h files, one in ntpd/ used only by ntpd, and another in 6 | * include/ used by libntp and utilities. This relies on the source 7 | * file's directory being ahead of include/ in the include search. 8 | * 9 | * The ntpd variant of declcond.h declares "debug" only #ifdef DEBUG, 10 | * as the --disable-debugging version of ntpd should not reference 11 | * "debug". The libntp and utilities variant always declares debug, 12 | * as it is used in those codebases even without DEBUG defined. 13 | */ 14 | #ifndef DECLCOND_H 15 | #define DECLCOND_H 16 | 17 | #ifdef DEBUG /* uncommented in ntpd/declcond.h */ 18 | extern int debug; 19 | #endif /* uncommented in ntpd/declcond.h */ 20 | 21 | #endif /* DECLCOND_H */ 22 | -------------------------------------------------------------------------------- /ntpd/invoke-ntp.conf.menu: -------------------------------------------------------------------------------- 1 | * ntp.conf Notes:: Notes about ntp.conf 2 | -------------------------------------------------------------------------------- /ntpd/invoke-ntp.keys.menu: -------------------------------------------------------------------------------- 1 | * ntp.keys Notes:: Notes about ntp.keys 2 | -------------------------------------------------------------------------------- /ntpd/invoke-ntpd.menu: -------------------------------------------------------------------------------- 1 | * ntpd Invocation:: Invoking ntpd 2 | -------------------------------------------------------------------------------- /ntpd/keyword-gen-utd: -------------------------------------------------------------------------------- 1 | * Generated 2016-01-16 08:33:03 UTC diff_ignore_line 2 | -------------------------------------------------------------------------------- /ntpd/ntpdsim-opts.def: -------------------------------------------------------------------------------- 1 | /* -*- Mode: Text -*- */ 2 | 3 | autogen definitions options; 4 | 5 | #include copyright.def 6 | #include homerc.def 7 | 8 | prog-name = "ntpdsim"; 9 | prog-title = "NTP daemon simulation program"; 10 | 11 | #define SIM 12 | #include ntpdbase-opts.def 13 | 14 | detail = <<- _END_DETAIL 15 | _END_DETAIL; 16 | -------------------------------------------------------------------------------- /ntpd/ntpdsim-opts.menu: -------------------------------------------------------------------------------- 1 | * ntpdsim Invocation:: Invoking ntpdsim 2 | -------------------------------------------------------------------------------- /ntpd/ppsapi_timepps.h: -------------------------------------------------------------------------------- 1 | /* ppsapi_timepps.h */ 2 | 3 | /* 4 | * This logic first tries to get the timepps.h file from a standard 5 | * location, and then from our include/ subdirectory. 6 | */ 7 | 8 | #ifdef HAVE_TIMEPPS_H 9 | # include 10 | #else 11 | # ifdef HAVE_SYS_TIMEPPS_H 12 | # include 13 | # else 14 | # ifdef HAVE_CIOGETEV 15 | # include "timepps-SunOS.h" 16 | # else 17 | # ifdef HAVE_TIOCGPPSEV 18 | # include "timepps-Solaris.h" 19 | # else 20 | # ifdef TIOCDCDTIMESTAMP 21 | # include "timepps-SCO.h" 22 | # endif 23 | # endif 24 | # endif 25 | # endif 26 | #endif 27 | -------------------------------------------------------------------------------- /ntpd/rc_cmdlength.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #if HAVE_UNISTD_H 5 | # include 6 | #endif 7 | 8 | 9 | /* Bug 2853 */ 10 | /* evaluate the length of the command sequence. This breaks at the first 11 | * char that is not >= SPACE and <= 127 after trimming from the right. 12 | */ 13 | size_t 14 | remoteconfig_cmdlength( 15 | const char *src_buf, 16 | const char *src_end 17 | ) 18 | { 19 | const char *scan; 20 | unsigned char ch; 21 | 22 | /* trim whitespace & garbage from the right */ 23 | while (src_end != src_buf) { 24 | ch = src_end[-1]; 25 | if (ch > ' ' && ch < 128) 26 | break; 27 | --src_end; 28 | } 29 | /* now do a forward scan */ 30 | for (scan = src_buf; scan != src_end; ++scan) { 31 | ch = scan[0]; 32 | if ((ch < ' ' || ch >= 128) && ch != '\t') 33 | break; 34 | } 35 | return (size_t)(scan - src_buf); 36 | } 37 | -------------------------------------------------------------------------------- /ntpd/refclock_jjy.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/ntpd/refclock_jjy.c -------------------------------------------------------------------------------- /ntpdate/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL = 2 | 3 | BUILT_SOURCES = 4 | CLEANFILES = 5 | 6 | bin_PROGRAMS = $(NTPDATE_DB) 7 | libexec_PROGRAMS = $(NTPDATE_DL) 8 | sbin_PROGRAMS = $(NTPDATE_DS) 9 | 10 | EXTRA_PROGRAMS = ntpdate 11 | 12 | AM_CFLAGS = $(CFLAGS_NTP) 13 | 14 | AM_CPPFLAGS = $(NTP_INCS) 15 | AM_CPPFLAGS += $(CPPFLAGS_NTP) 16 | 17 | AM_LDFLAGS = $(LDFLAGS_NTP) 18 | 19 | # LDADD might need RESLIB and ADJLIB 20 | LDADD = version.o ../libntp/libntp.a 21 | ntpdate_LDADD = $(LDADD) $(LDADD_LIBNTP) $(PTHREAD_LIBS) $(LIBOPTS_LDADD) 22 | ntpdate_LDADD += $(LIBM) $(LDADD_NTP) 23 | DISTCLEANFILES= .version version.c stamp-v 24 | noinst_HEADERS= ntpdate.h 25 | 26 | $(PROGRAMS): $(LDADD) 27 | 28 | $(top_srcdir)/sntp/scm-rev: 29 | cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev 30 | 31 | version.c: $(ntpdate_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev 32 | env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpdate 33 | 34 | version.o: version.c 35 | env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o 36 | 37 | include $(top_srcdir)/bincheck.mf 38 | include $(top_srcdir)/sntp/check-libntp.mf 39 | include $(top_srcdir)/depsver.mf 40 | include $(top_srcdir)/includes.mf 41 | -------------------------------------------------------------------------------- /ntpdate/README: -------------------------------------------------------------------------------- 1 | README file for directory ./ntpdate of the NTP Version 4 distribution 2 | 3 | This directory contains the sources for the ntpdate utility program. See 4 | the README and RELNOTES files in the parent directory for directions on 5 | how to make and install this program. The current version number of this 6 | program is in the version.c file. 7 | 8 | -------------------------------------------------------------------------------- /ntpdc/README: -------------------------------------------------------------------------------- 1 | README file for directory ./xntpdc of the NTP Version 4 distribution 2 | 3 | This directory contains the sources for the xntpdc utility program. See 4 | the README and RELNOTES files in the parent directory for directions on 5 | how to make and install this program. The current version number of this 6 | program is in the version.c file. 7 | -------------------------------------------------------------------------------- /ntpdc/invoke-ntpdc.menu: -------------------------------------------------------------------------------- 1 | * ntpdc Invocation:: Invoking ntpdc 2 | -------------------------------------------------------------------------------- /ntpdc/nl.pl.in: -------------------------------------------------------------------------------- 1 | #! @PATH_PERL@ -w 2 | 3 | $found = 0; 4 | $last = 0; 5 | $debug = 0; 6 | 7 | while (<>) { 8 | next if /^#/; 9 | next if /^\s*$/; 10 | if (/^typedef union req_data_u_tag/) { 11 | $found = 1; 12 | } 13 | if (/^struct info_dns_assoc/) { 14 | $last = 1; 15 | } 16 | if ($found) { 17 | if (/^(struct\s*\w*)\s*{\s*$/) { 18 | $type = $1; 19 | print STDERR "type = '$type'\n" if $debug; 20 | printf " printf(\"sizeof($type) = %%d\\n\", \n\t (int) sizeof($type));\n"; 21 | next; 22 | } 23 | if (/^typedef (union\s*\w*)\s*{\s*$/) { 24 | $type = $1; 25 | print STDERR "union = '$type'\n" if $debug; 26 | printf " printf(\"sizeof($type) = %%d\\n\", \n\t (int) sizeof($type));\n"; 27 | next; 28 | } 29 | if (/\s*\w+\s+(\w*)\s*(\[.*\])?\s*;\s*$/) { 30 | $field = $1; 31 | print STDERR "\tfield = '$field'\n" if $debug; 32 | printf " printf(\"offsetof($field) = %%d\\n\", \n\t (int) offsetof($type, $field));\n"; 33 | next; 34 | } 35 | if (/^}\s*\w*\s*;\s*$/) { 36 | printf " printf(\"\\n\");\n\n"; 37 | $found = 0 if $last; 38 | next; 39 | } 40 | print STDERR "Unmatched line: $_"; 41 | exit 1; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ntpdc/nl_in.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "ntpdc.h" 3 | #include "ntp_request.h" 4 | -------------------------------------------------------------------------------- /ntpdc/ntpdc-layout.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ntpdc-layout - print layout of NTP mode 7 request/response packets 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include "ntpdc.h" 10 | #include "ntp_stdlib.h" 11 | 12 | #if defined(IMPL_XNTPD_OLD) && IMPL_XNTPD != 3 13 | #error Unexpected IMPL_XNTPD 14 | #endif 15 | 16 | int 17 | main(void) 18 | { 19 | #include "nl.c" 20 | 21 | return (EXIT_SUCCESS); 22 | } 23 | -------------------------------------------------------------------------------- /ntpq/README: -------------------------------------------------------------------------------- 1 | README file for directory ./ntpq of the NTP Version 4 distribution 2 | 3 | This directory contains the sources for the ntpq utility program. See 4 | the README and RELNOTES files in the parent directory for directions on 5 | how to make and install this program. The current version number of this 6 | program is in the version.c file. 7 | -------------------------------------------------------------------------------- /ntpq/invoke-ntpq.menu: -------------------------------------------------------------------------------- 1 | * ntpq Invocation:: Invoking ntpq 2 | -------------------------------------------------------------------------------- /ntpsnmpd/invoke-ntpsnmpd.menu: -------------------------------------------------------------------------------- 1 | * ntpsnmpd Invocation:: Invoking ntpsnmpd 2 | -------------------------------------------------------------------------------- /ntpsnmpd/netsnmp_daemonize.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/ntpsnmpd/netsnmp_daemonize.c -------------------------------------------------------------------------------- /ntpsnmpd/ntp_snmp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ntp_snmp.h -- common net-snmp header includes and workaround 3 | * for Autoconf-related PACKAGE_* redefinitions between 4 | * net-snmp and NTP. 5 | * 6 | * Currently ntpsnmpd *.c files are exceptions to the rule that every .c 7 | * file should include before any other headers. It would be 8 | * ideal to rearrange its includes so that our config.h is first, but 9 | * that is complicated by the redefinitions between our config.h and 10 | * net-snmp/net-snmp-config.h. 11 | */ 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | #ifdef PACKAGE_BUGREPORT 18 | # undef PACKAGE_BUGREPORT 19 | #endif 20 | #ifdef PACKAGE_NAME 21 | # undef PACKAGE_NAME 22 | #endif 23 | #ifdef PACKAGE_STRING 24 | # undef PACKAGE_STRING 25 | #endif 26 | #ifdef PACKAGE_TARNAME 27 | # undef PACKAGE_TARNAME 28 | #endif 29 | #ifdef PACKAGE_URL 30 | # undef PACKAGE_URL 31 | #endif 32 | #ifdef PACKAGE_VERSION 33 | # undef PACKAGE_VERSION 34 | #endif 35 | 36 | #include 37 | #include 38 | -------------------------------------------------------------------------------- /parseutil/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL= 2 | 3 | BUILT_SOURCES = 4 | CLEANFILES = 5 | noinst_PROGRAMS = @TESTDCF@ @DCFD@ 6 | EXTRA_PROGRAMS = testdcf dcfd 7 | 8 | AM_CFLAGS = $(CFLAGS_NTP) 9 | 10 | AM_CPPFLAGS = $(NTP_INCS) 11 | AM_CPPFLAGS += $(CPPFLAGS_NTP) 12 | 13 | LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) 14 | 15 | ETAGS_ARGS = Makefile.am 16 | DISTCLEANFILES = $(EXTRA_PROGRAMS) 17 | 18 | check-local: @DCFD@ 19 | case "$(noinst_PROGRAMS)" in \ 20 | *dcfd*) ./dcfd -Y ;; \ 21 | esac 22 | 23 | include $(top_srcdir)/depsver.mf 24 | include $(top_srcdir)/includes.mf 25 | -------------------------------------------------------------------------------- /parseutil/README: -------------------------------------------------------------------------------- 1 | This directory contains some DCF77 related programs. 2 | They have not yet fully been ported to architectures other than Sun with 3 | SunOS 4.x. So if you want to try them you are on your own - a little 4 | porting may be necessary. 5 | 6 | parsetest: simple parse streams module test 7 | Works only under SunOS with parse Streams Module loaded 8 | and Meinberg-Clocks 9 | 10 | testdcf: simple DCF77 raw impulse test program via 50Baud RS232 11 | 12 | dcfd: simple DCF77 raw impulse receiver with NTP loopfilter 13 | mechanics for synchronisation (allows DCF77 synchronisation 14 | without network code in a nutshell) 15 | 16 | Frank Kardel 17 | -------------------------------------------------------------------------------- /ports/winnt/include/arpa/inet.h: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * Dummy Header for Unix to Windows NT portability 3 | * Created for NTP package 4 | **************************************************************/ 5 | -------------------------------------------------------------------------------- /ports/winnt/include/clockstuff.h: -------------------------------------------------------------------------------- 1 | #ifndef _CLOCKSTUFF_H 2 | #define _CLOCKSTUFF_H 3 | 4 | #include 5 | #include 6 | 7 | #include "ntp_fp.h" 8 | #include "ntp_syslog.h" 9 | 10 | 11 | void init_winnt_time(void); 12 | void reset_winnt_time(void); 13 | void lock_thread_to_processor(HANDLE); 14 | 15 | /* 100ns intervals between 1/1/1601 and 1/1/1970 as reported by 16 | * SystemTimeToFileTime() 17 | */ 18 | 19 | #define FILETIME_1970 0x019db1ded53e8000 20 | #define HECTONANOSECONDS 10000000 21 | 22 | /* 23 | * Multimedia Timer 24 | */ 25 | 26 | void set_mm_timer(int); 27 | 28 | enum { 29 | MM_TIMER_LORES, 30 | MM_TIMER_HIRES 31 | }; 32 | 33 | /* 34 | * get_sys_time_as_filetime is a function pointer to 35 | * either GetSystemTimeAsFileTime provided by Windows 36 | * or ntpd's interpolating replacement. 37 | */ 38 | typedef void (WINAPI *PGSTAFT)(LPFILETIME pftResult); 39 | extern PGSTAFT get_sys_time_as_filetime; 40 | extern PGSTAFT pGetSystemTimePreciseAsFileTime; 41 | 42 | void lock_thread_to_processor(HANDLE); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /ports/winnt/include/hopf_PCI_io.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/ports/winnt/include/hopf_PCI_io.h -------------------------------------------------------------------------------- /ports/winnt/include/netdb.h: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * Dummy Header for Unix to Windows NT portability 3 | * Created for NTP package 4 | **************************************************************/ 5 | -------------------------------------------------------------------------------- /ports/winnt/include/ntp_iocompletionport.h: -------------------------------------------------------------------------------- 1 | #if !defined __ntp_iocompletionport_h 2 | # define __ntp_iocompletionport_h 3 | 4 | #include "ntp_fp.h" 5 | #include "ntp.h" 6 | #include "clockstuff.h" 7 | #include "ntp_worker.h" 8 | 9 | # if defined(HAVE_IO_COMPLETION_PORT) 10 | 11 | extern void init_io_completion_port(void); 12 | extern void uninit_io_completion_port(void); 13 | 14 | extern int io_completion_port_add_socket(SOCKET fd, struct interface *); 15 | 16 | struct refclockio; /* in ntp_refclock.h but inclusion here triggers problems */ 17 | extern int io_completion_port_add_clock_io(struct refclockio *rio); 18 | extern void io_completion_port_remove_clock_io(struct refclockio *rio); 19 | extern int io_completion_port_sendto(SOCKET, void *, size_t, sockaddr_u *); 20 | 21 | extern int GetReceivedBuffers(void); 22 | 23 | extern HANDLE WaitableExitEventHandle; 24 | 25 | # endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /ports/winnt/include/ntp_timer.h: -------------------------------------------------------------------------------- 1 | #ifndef NTP_TIMER_H 2 | #define NTP_TIMER_H 3 | 4 | extern void timer_clr_stats(void); 5 | 6 | #endif /* NTP_TIMER_H */ 7 | -------------------------------------------------------------------------------- /ports/winnt/include/sys/ioctl.h: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * Dummy Header for Unix to Windows NT portability 3 | * Created for NTP package 4 | **************************************************************/ 5 | 6 | #ifndef _IOCTL_H 7 | #define _IOCTL_H 8 | 9 | #include "win32_io.h" 10 | 11 | #endif -------------------------------------------------------------------------------- /ports/winnt/include/sys/param.h: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * Dummy Header for Unix to Windows NT portability 3 | * Created for NTP package 4 | **************************************************************/ 5 | -------------------------------------------------------------------------------- /ports/winnt/include/sys/resource.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ports/winnt/include/sys/resource.h 3 | * 4 | * routines declared in Unix systems' sys/resource.h 5 | */ 6 | 7 | #define PRIO_PROCESS 0 8 | #define NTP_PRIO (-12) 9 | 10 | int setpriority(int, int, int); /* winnt\libntp\setpriority.c */ 11 | -------------------------------------------------------------------------------- /ports/winnt/include/sys/signal.h: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * Dummy Header for Unix to Windows NT portability 3 | * Created for NTP package 4 | **************************************************************/ 5 | -------------------------------------------------------------------------------- /ports/winnt/include/sys/time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ports/winnt/include/sys/time.h 3 | * 4 | * routines declared in Unix systems' sys/time.h 5 | */ 6 | 7 | #ifndef SYS_TIME_H 8 | #define SYS_TIME_H 9 | 10 | #include "ntp_types.h" 11 | #include 12 | #include 13 | 14 | typedef struct timespec { 15 | time_t tv_sec; 16 | long tv_nsec; 17 | } timespec_t; 18 | 19 | #define TIMEOFDAY 0 /* getclock() clktyp arg */ 20 | extern int getclock(int, struct timespec *ts); 21 | extern int gettimeofday(struct timeval *, void *); 22 | extern int settimeofday(struct timeval *); 23 | extern void init_win_precise_time(void); 24 | 25 | #endif /* SYS_TIME_H */ 26 | -------------------------------------------------------------------------------- /ports/winnt/include/sys/wait.h: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * Dummy Header for Unix to Windows NT portability 3 | * Created for NTP package 4 | **************************************************************/ 5 | -------------------------------------------------------------------------------- /ports/winnt/include/unistd.h: -------------------------------------------------------------------------------- 1 | /************************************************************** 2 | * Dummy Header for Unix to Windows NT portability 3 | * Created for NTP package 4 | **************************************************************/ 5 | -------------------------------------------------------------------------------- /ports/winnt/include/win32_io.h: -------------------------------------------------------------------------------- 1 | #ifndef WIN32_IO_H 2 | #define WIN32_IO_H 3 | 4 | extern void InitSockets(void); 5 | extern void connection_reset_fix(SOCKET fd, sockaddr_u *addr); 6 | 7 | #endif /* WIN32_IO_H */ 8 | -------------------------------------------------------------------------------- /ports/winnt/libntp/MSG00001.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/ports/winnt/libntp/MSG00001.bin -------------------------------------------------------------------------------- /ports/winnt/libntp/SetSystemTime.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include "clockstuff.h" 5 | #include "ntp_stdlib.h" 6 | #include "ntp_unixtime.h" 7 | 8 | pset_tod_using set_tod_using = NULL; 9 | 10 | int 11 | ntp_set_tod( 12 | struct timeval *tv, 13 | void *tzp 14 | ) 15 | { 16 | SYSTEMTIME st; 17 | union { 18 | FILETIME ft; 19 | ULONGLONG ull; 20 | } t; 21 | 22 | UNUSED_ARG(tzp); 23 | 24 | t.ull = FILETIME_1970 + 25 | (ULONGLONG)tv->tv_sec * 10 * 1000 * 1000 + 26 | (ULONGLONG)tv->tv_usec * 10; 27 | 28 | if (!FileTimeToSystemTime(&t.ft, &st) || !SetSystemTime(&st)) { 29 | msyslog(LOG_ERR, "SetSystemTime failed: %m"); 30 | return -1; 31 | } 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /ports/winnt/libntp/messages.rc: -------------------------------------------------------------------------------- 1 | LANGUAGE 0x9,0x1 2 | 1 11 "MSG00001.bin" 3 | -------------------------------------------------------------------------------- /ports/winnt/libntp/util_clockstuff.c: -------------------------------------------------------------------------------- 1 | #ifdef HAVE_CONFIG_H 2 | #include "config.h" 3 | #endif 4 | 5 | #include "ntp_syslog.h" 6 | #include "ntp_stdlib.h" 7 | #include "ntp_unixtime.h" 8 | #include "clockstuff.h" 9 | 10 | int 11 | gettimeofday( 12 | struct timeval * tv, 13 | void * ignored 14 | ) 15 | { 16 | struct timespec ts; 17 | 18 | UNUSED_ARG(ignored); 19 | 20 | getclock(TIMEOFDAY, &ts); 21 | 22 | tv->tv_sec = ts.tv_sec; 23 | tv->tv_usec = ts.tv_nsec / 10; 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /ports/winnt/ntpd/hopf_PCI_io.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/ports/winnt/ntpd/hopf_PCI_io.c -------------------------------------------------------------------------------- /ports/winnt/ppsapi/loopback/src/loopback-ppsapi.def: -------------------------------------------------------------------------------- 1 | LIBRARY "loopback-ppsapi-provider.dll" 2 | ; This is *needed* for x86 (32bit) builds, as it makes sure 3 | ; that the *undecorated* names are exported in the DLL. 4 | ; It *cannot* be used for the x64 (64bit) builds. 5 | EXPORTS 6 | ppsapi_prov_init 7 | prov_time_pps_create 8 | prov_time_pps_destroy 9 | prov_time_pps_fetch 10 | prov_time_pps_kcbind 11 | prov_time_pps_setparams -------------------------------------------------------------------------------- /ports/winnt/ppsapi/loopback/src/sys/time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This sys/time.h is part of ppsapi-prov skeleton sample source code 3 | * for a Windows PPSAPI provider DLL. It was adapted from 4 | * ports/winnt/include/sys/time.h in ntpd. 5 | */ 6 | 7 | #ifndef SYS_TIME_H 8 | #define SYS_TIME_H 9 | 10 | #include 11 | #include 12 | 13 | typedef struct timespec { 14 | time_t tv_sec; 15 | long tv_nsec; 16 | } timespec_t; 17 | 18 | #endif /* SYS_TIME_H */ 19 | -------------------------------------------------------------------------------- /ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.def: -------------------------------------------------------------------------------- 1 | LIBRARY "skeleton-ppsapi-provider.dll" 2 | 3 | EXPORTS 4 | ppsapi_prov_init 5 | prov_time_pps_create 6 | prov_time_pps_destroy 7 | prov_time_pps_fetch 8 | prov_time_pps_kcbind 9 | prov_time_pps_setparams -------------------------------------------------------------------------------- /ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.h: -------------------------------------------------------------------------------- 1 | // 2 | // serialpps-ppsapi-provider.h 3 | // 4 | // For this tiny project the single header serves as a precompiled header 5 | // as well, meaning all the bulky headers are included before or within it. 6 | // Within, in this case. 7 | // 8 | 9 | #define _CRT_SECURE_NO_WARNINGS 10 | #include 11 | /* Prevent inclusion of winsock.h in windows.h */ 12 | #ifndef _WINSOCKAPI_ 13 | #define _WINSOCKAPI_ 14 | #endif 15 | #include 16 | typedef DWORD u_int32; 17 | #include "sys/time.h" 18 | #include "../../include/timepps.h" 19 | 20 | #ifndef UNUSED 21 | #define UNUSED(item) ((void)(item)) 22 | #endif 23 | -------------------------------------------------------------------------------- /ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual C++ Express 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "skeleton-ppsapi-provider", "skeleton-ppsapi-provider.vcproj", "{F7842ACD-EB61-4D65-9999-AFB0E77E63EA}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {F7842ACD-EB61-4D65-9999-AFB0E77E63EA}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {F7842ACD-EB61-4D65-9999-AFB0E77E63EA}.Debug|Win32.Build.0 = Debug|Win32 14 | {F7842ACD-EB61-4D65-9999-AFB0E77E63EA}.Release|Win32.ActiveCfg = Release|Win32 15 | EndGlobalSection 16 | GlobalSection(SolutionProperties) = preSolution 17 | HideSolutionNode = FALSE 18 | EndGlobalSection 19 | EndGlobal 20 | -------------------------------------------------------------------------------- /ports/winnt/ppsapi/skelprov/sys/time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This sys/time.h is part of ppsapi-prov skeleton sample source code 3 | * for a Windows PPSAPI provider DLL. It was adapted from 4 | * ports/winnt/include/sys/time.h in ntpd. 5 | */ 6 | 7 | #ifndef SYS_TIME_H 8 | #define SYS_TIME_H 9 | 10 | #include 11 | #include 12 | 13 | typedef struct timespec { 14 | time_t tv_sec; 15 | long tv_nsec; 16 | } timespec_t; 17 | 18 | #endif /* SYS_TIME_H */ 19 | -------------------------------------------------------------------------------- /ports/winnt/vs2008/debug-x64.vsprops: -------------------------------------------------------------------------------- 1 | 2 | 7 | 15 | 20 | 21 | -------------------------------------------------------------------------------- /ports/winnt/vs2008/debug.vsprops: -------------------------------------------------------------------------------- 1 | 2 | 7 | 15 | 20 | 21 | -------------------------------------------------------------------------------- /ports/winnt/vs2008/release-x64.vsprops: -------------------------------------------------------------------------------- 1 | 2 | 7 | 16 | 21 | 22 | -------------------------------------------------------------------------------- /ports/winnt/vs2008/release.vsprops: -------------------------------------------------------------------------------- 1 | 2 | 7 | 16 | 21 | 22 | -------------------------------------------------------------------------------- /ports/winnt/vs2013/debug-x64.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | <_ProjectFileVersion>12.0.30501.0 8 | 9 | 10 | 11 | Disabled 12 | true 13 | $(OPENSSL64_INC);%(AdditionalIncludeDirectories) 14 | _DEBUG;OPENSSL;%(PreprocessorDefinitions) 15 | MultiThreadedDebug 16 | 17 | 18 | $(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies) 19 | MachineX64 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ports/winnt/vs2013/debug.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | <_ProjectFileVersion>12.0.30501.0 8 | <_PropertySheetDisplayName>debug-x86 9 | 10 | 11 | 12 | Disabled 13 | true 14 | $(OPENSSL_INC);%(AdditionalIncludeDirectories) 15 | _DEBUG;OPENSSL;%(PreprocessorDefinitions) 16 | MultiThreadedDebug 17 | 18 | 19 | $(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies) 20 | MachineX86 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ports/winnt/vs2013/instsrv/instsrv.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {88b66c4c-94b1-4f5b-9746-4fe09cdfae66} 6 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat 7 | 8 | 9 | {d9dc516d-d575-4027-8a48-b67dc1ba58c3} 10 | h;hpp;hxx;hm;inl 11 | 12 | 13 | {afc3883c-9da2-4632-8941-c77432dbd317} 14 | ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ports/winnt/vs2013/release-x64.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | <_ProjectFileVersion>12.0.30501.0 8 | 9 | 10 | 11 | Full 12 | AnySuitable 13 | true 14 | $(OPENSSL64_INC);%(AdditionalIncludeDirectories) 15 | NDEBUG;OPENSSL;%(PreprocessorDefinitions) 16 | MultiThreaded 17 | 18 | 19 | $(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies) 20 | MachineX64 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /scripts/build/Makefile.am: -------------------------------------------------------------------------------- 1 | run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \ 2 | autogen -L ../sntp/include -L ../sntp/ag-tpl 3 | 4 | noinst_SCRIPTS = mkver 5 | 6 | NULL= 7 | EXTRA_DIST = \ 8 | check--help \ 9 | checkChangeLog \ 10 | checkHtmlFileDates \ 11 | fixautomakedepsmagic \ 12 | genCommitLog \ 13 | genver \ 14 | updateBEDate \ 15 | UpdatePoint \ 16 | VersionName \ 17 | $(NULL) 18 | -------------------------------------------------------------------------------- /scripts/build/addChangeLogTag: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | set -e 4 | 5 | clt=`./scripts/build/genChangeLogTag` 6 | first=`line < ChangeLog` 7 | 8 | case "$first" in 9 | ---) echo "ChangeLog is -stable" 10 | ( \ 11 | echo $first \ 12 | && echo $clt \ 13 | && sed 1d < ChangeLog \ 14 | ) > ChangeLog.new \ 15 | && mv ChangeLog.new ChangeLog 16 | ;; 17 | *) echo "ChangeLog is not -stable" 18 | ( \ 19 | echo $clt \ 20 | && cat ChangeLog \ 21 | ) > ChangeLog.new \ 22 | && mv ChangeLog.new ChangeLog 23 | ;; 24 | esac 25 | -------------------------------------------------------------------------------- /scripts/build/check--help: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # Look at the file specified in $1 to see if it contains 'no --help'. 4 | # If it does: 5 | # - Squawk 6 | # - rename the file to ($1)- 7 | # - exit with a non-zero status. 8 | # otherwise: 9 | # - exit with a 0 status. 10 | 11 | if test ! -f $1 12 | then 13 | echo "$0: $1 is not a regular file!" 2>&3 14 | exit 1 15 | fi 16 | 17 | if grep -q 'no --help' $1 18 | then 19 | echo "$0: $1 contains 'no --help'!" 2>&3 20 | mv ${1} ${1}- 21 | exit 1 22 | fi 23 | -------------------------------------------------------------------------------- /scripts/build/checkChangeLog: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | . ./packageinfo.sh 4 | 5 | # HMS: Irix doesn't have 'head'... 6 | cl1=`head -1 ChangeLog || sed -e 1q ChangeLog` 7 | 8 | case "$repotype" in 9 | dev) ;; 10 | stable) ;; 11 | *) echo "Unexpected repotype <$repotype>" 12 | exit 1 13 | ;; 14 | esac 15 | 16 | case "$repotype$cl1" in 17 | dev---) 18 | echo "Dev repo ChangeLog must not begin with '---'!" 19 | exit 1 20 | ;; 21 | dev*) 22 | ;; 23 | stable---) 24 | ;; 25 | stable*) 26 | echo "Stable repo Changelog must begin with '---'!" 27 | exit 1 28 | ;; 29 | esac 30 | -------------------------------------------------------------------------------- /scripts/build/checkHtmlFileDates: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | bk version > /dev/null 2>&1 || exit 0 4 | 5 | for i in `find * -type f -name '*.html' -print | grep -v SCCS/` 6 | do 7 | # echo $i 8 | set `bk diffs $i | wc -l` 9 | lines=$1 10 | case "$lines" in 11 | 0) ;; 12 | *) echo "Processing <$i>" 13 | ../scripts/build/updateBEDate $i 14 | ;; 15 | esac 16 | done 17 | -------------------------------------------------------------------------------- /scripts/build/fixautomakedepsmagic: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | prog=`basename $0` 4 | 5 | 6 | t=/tmp/$prog.$$ 7 | 8 | trap 'rm -f ${t} ; exit 1' 1 3 15 9 | 10 | while [ $# -gt 0 ]; do 11 | f=$1 12 | shift 13 | sed -e '/^DEPS_MAGIC :=/,/^-include \$/s/^/#/' $f > $t 14 | c="diff $f $t" 15 | echo $c 16 | $c 17 | tstatus=$? 18 | if [ $tstatus = 0 ]; then 19 | echo "$prog":" $f not modified" 20 | elif [ ! -w $f ]; then 21 | echo "$prog":" $f not not writable" 22 | else 23 | c="cp $t $f" 24 | echo $c 25 | $c 26 | fi 27 | rm -f $t 28 | done 29 | -------------------------------------------------------------------------------- /scripts/build/genChangeLogTag: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | dversion=`./scripts/build/VersionName` 4 | tag=`date +"(${dversion}) %Y/%m/%d Released by Harlan Stenn "` 5 | 6 | echo $tag 7 | -------------------------------------------------------------------------------- /scripts/build/genCommitLog: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | set -e 4 | 5 | GCL_REMOVEWRITE=0 6 | . ./packageinfo.sh 7 | if [ ! -w . ] ; then 8 | GCL_REMOVEWRITE=1 9 | chmod u+w . 10 | [ -f CommitLog -a ! -w CommitLog ] && chmod u+w CommitLog 11 | fi 12 | bk changes -v -m -r${CLTAG}.. > CommitLog.new 13 | mv CommitLog.new CommitLog 14 | case "$GCL_REMOVEWRITE" in 15 | 1) chmod a-w CommitLog . 16 | esac 17 | -------------------------------------------------------------------------------- /scripts/build/mkver.in: -------------------------------------------------------------------------------- 1 | #!@CONFIG_SHELL@ 2 | PROG=${1-UNKNOWN} 3 | 4 | ConfStr="$PROG" 5 | 6 | ConfStr="$ConfStr @VERSION@" 7 | 8 | case "$CSET" in 9 | '') ;; 10 | *) ConfStr="$ConfStr@$CSET" ;; 11 | esac 12 | 13 | case "@VER_SUFFIX@" in 14 | '') ;; 15 | *) ConfStr="${ConfStr}-@VER_SUFFIX@" ;; 16 | esac 17 | 18 | ConfStr="$ConfStr `LC_TIME=C TZ=UTC date`" 19 | 20 | if [ ! -f .version ]; then 21 | echo 0 > .version 22 | fi 23 | RUN="`cat .version`" 24 | RUN="`expr $RUN + 1`" 25 | echo $RUN > .version 26 | 27 | ConfStr="$ConfStr (${RUN})" 28 | 29 | echo "Version <${ConfStr}>"; 30 | 31 | rm -f version.c 32 | cat > version.c << -EoF- 33 | /* 34 | * version file for $PROG 35 | */ 36 | #include 37 | const char * Version = "${ConfStr}"; 38 | -EoF- 39 | -------------------------------------------------------------------------------- /scripts/calc_tickadj/invoke-calc_tickadj.menu: -------------------------------------------------------------------------------- 1 | * calc_tickadj Invocation:: Invoking calc_tickadj 2 | -------------------------------------------------------------------------------- /scripts/deprecated/hpadjtime.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | val=1 3 | if [ -f /bin/uname -o -f /usr/bin/uname ]; then 4 | set `uname -a | tr '[A-Z]' '[a-z]'` 5 | case "$1" in 6 | hp-ux) case "$3" in 7 | *.10.*) val=1 ;; 8 | *.09.03 | *.09.10) case "$5" in 9 | 9000/3*) val=1 ;; 10 | *) val=0 ;; 11 | esac ;; 12 | *) val=0 ;; 13 | esac 14 | ;; 15 | *) 16 | esac 17 | fi 18 | exit $val 19 | -------------------------------------------------------------------------------- /scripts/deprecated/ntp-close: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | lynx -source http://www.eecis.udel.edu/~mills/ntp/clock2.htm | 4 | sed -n -e 's,).*,,' -e' /([0-9.]*$/s/.*(//p' | 5 | xargs ntpdate -q | 6 | sort -n +7 > /tmp/ntp-close 7 | 8 | # From: Neal McBurnett 9 | -------------------------------------------------------------------------------- /scripts/deprecated/ntp-restart: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # This script can be used to kill and restart the NTP daemon. Edit the 4 | # /usr/local/bin/ntpd line to fit. 5 | # 6 | kill -INT `ps -ax | egrep "ntpd" | egrep -v "egrep" | sed 's/^\([ 0-9]*\) .*/\1'/` 7 | sleep 10 8 | /usr/local/bin/ntpd -g 9 | /usr/local/bin/ntp-wait 10 | exit 0 11 | -------------------------------------------------------------------------------- /scripts/invoke-plot_summary.menu: -------------------------------------------------------------------------------- 1 | * plot_summary Invocation:: Invoking plot_summary 2 | -------------------------------------------------------------------------------- /scripts/invoke-summary.menu: -------------------------------------------------------------------------------- 1 | * summary Invocation:: Invoking summary 2 | -------------------------------------------------------------------------------- /scripts/lib/Makefile.am: -------------------------------------------------------------------------------- 1 | perllibdir = @PERLLIBDIR@ 2 | 3 | nobase_perllib_DATA = NTP/Util.pm 4 | 5 | EXTRA_DIST = ${nobase_perllib_DATA} 6 | -------------------------------------------------------------------------------- /scripts/monitoring/ntploopwatch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/scripts/monitoring/ntploopwatch -------------------------------------------------------------------------------- /scripts/ntp-wait/invoke-ntp-wait.menu: -------------------------------------------------------------------------------- 1 | * ntp-wait Invocation:: Invoking ntp-wait 2 | -------------------------------------------------------------------------------- /scripts/ntpsweep/invoke-ntpsweep.menu: -------------------------------------------------------------------------------- 1 | * ntpsweep Invocation:: Invoking ntpsweep 2 | -------------------------------------------------------------------------------- /scripts/ntptrace/invoke-ntptrace.menu: -------------------------------------------------------------------------------- 1 | * ntptrace Invocation:: Invoking ntptrace 2 | -------------------------------------------------------------------------------- /scripts/ntptrace/ntptrace.texi: -------------------------------------------------------------------------------- 1 | \input texinfo @c -*-texinfo-*- 2 | @c %**start of header 3 | @setfilename ntptrace.info 4 | @settitle Ntptrace User's Manual 5 | @include ../../sntp/include/version.texi 6 | @paragraphindent 2 7 | @c %**end of header 8 | 9 | @ifinfo 10 | This file documents the use of @code{ntptrace}, 11 | a program from the NTP Project 12 | @end ifinfo 13 | 14 | @direntry 15 | * ntptrace: (ntptrace). Trace the ntp server to the primary time source. 16 | @end direntry 17 | 18 | @titlepage 19 | @title ntptrace User's Manual 20 | @subtitle ntptrace, version @value{VERSION}, @value{UPDATED} 21 | @c @author Max @email{foo@ntp.org} 22 | @end titlepage 23 | 24 | @c @page 25 | @c @vskip 0pt plus 1filll 26 | 27 | @node Top, ntptrace Description, (dir), (dir) 28 | @top Simple Network Time Protocol User Manual 29 | 30 | This document describes the use of the NTP Project's @code{ntptrace} program. 31 | This document applies to version @value{VERSION} of @code{ntptrace}. 32 | 33 | @shortcontents 34 | 35 | @menu 36 | * ntptrace Description:: Description 37 | * ntptrace Invocation:: Invoking ntptrace 38 | @end menu 39 | 40 | @include invoke-ntptrace.texi 41 | -------------------------------------------------------------------------------- /scripts/ntpver.in: -------------------------------------------------------------------------------- 1 | #!@CONFIG_SHELL@ 2 | # print version string of NTP daemon 3 | # Copyright (c) 1997 by Ulrich Windl 4 | # Modified 970318: Harlan Stenn: rewritten... 5 | # usage: ntpver hostname 6 | 7 | ntpq -c "rv 0 daemon_version" $* | @AWK@ '/daemon_version/ { print $2 }' 8 | -------------------------------------------------------------------------------- /scripts/plot_summary.texi: -------------------------------------------------------------------------------- 1 | \input texinfo @c -*-texinfo-*- 2 | @c %**start of header 3 | @setfilename plot_summary.info 4 | @settitle Plot_summary User's Manual 5 | @include ../sntp/include/version.texi 6 | @paragraphindent 2 7 | @c %**end of header 8 | 9 | @ifinfo 10 | This file documents the use of @code{plot_summary}, 11 | a program from the NTP Project 12 | @end ifinfo 13 | 14 | @direntry 15 | * plot_summary: (plot_summary). Summarize (something) 16 | @end direntry 17 | 18 | @titlepage 19 | @title plot_summary User's Manual 20 | @subtitle plot_summary, version @value{VERSION}, @value{UPDATED} 21 | @c @author Max @email{foo@ntp.org} 22 | @end titlepage 23 | 24 | @c @page 25 | @c @vskip 0pt plus 1filll 26 | 27 | @node Top, plot_summary Description, (dir), (dir) 28 | @top Plot_summary User Manual 29 | 30 | This document describes the use of the NTP Project's @code{plot_summary} program. 31 | This document applies to version @value{VERSION} of @code{plot_summary}. 32 | 33 | @shortcontents 34 | 35 | @menu 36 | * plot_summary Description:: Description 37 | * plot_summary Invocation:: Invoking plot_summary 38 | @end menu 39 | 40 | @include invoke-plot_summary.texi 41 | -------------------------------------------------------------------------------- /scripts/rc/README: -------------------------------------------------------------------------------- 1 | This directory contains some example rc scripts for ntpd. 2 | 3 | In general, ntpd should be started as soon as possible in the boot process. If 4 | any services require stable system clock, the ntpwait script should be run 5 | before them as late as possible. 6 | 7 | The rc.d contains scripts for systems using rc.d init system (originated in 8 | NetBSD). If a service requires stable system time, indicate it with TIMESYNC 9 | dependency and set ntpwait_enable to YES. 10 | 11 | For SysV init systems, you'll have to create links as /etc/rc2.d/S20ntpd and 12 | /etc/rc2.d/S80ntpwait yourself. (The numbers are just examples, try to give 13 | ntpd as much time as possible to synchronize before running ntpwait). 14 | -------------------------------------------------------------------------------- /scripts/rc/ntpwait: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | NTPWAIT=/usr/sbin/ntpwait 4 | 5 | ntpwait_start() { 6 | $NTPWAIT -v 7 | } 8 | 9 | case "$1" in 10 | 'start') 11 | ntpwait_start 12 | ;; 13 | *) 14 | echo "Usage: $0 (start)" 15 | esac 16 | -------------------------------------------------------------------------------- /scripts/rc/rc.d/TIMESYNC: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # PROVIDE: TIMESYNC 4 | # REQUIRE: LOGIN ntpwait 5 | 6 | # This depedency ensures that all services which require stable system clock 7 | # are run after ntpd is synchronized. It's run as late as possible, if you need 8 | # stable clock before login use BEFORE: LOGIN 9 | -------------------------------------------------------------------------------- /scripts/rc/rc.d/ntpd: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # PROVIDE: ntpd 4 | # REQUIRE: syslogd cleanvar devfs 5 | # BEFORE: SERVERS 6 | 7 | . /etc/rc.subr 8 | 9 | name="ntpd" 10 | rcvar="ntpd_enable" 11 | command="/usr/sbin/${name}" 12 | pidfile="/var/run/${name}.pid" 13 | start_precmd="ntpd_precmd" 14 | 15 | load_rc_config $name 16 | 17 | ntpd_precmd() 18 | { 19 | rc_flags="-c ${ntpd_config} ${ntpd_flags}" 20 | 21 | if checkyesno ntpd_sync_on_start; then 22 | rc_flags="-g $rc_flags" 23 | fi 24 | 25 | if [ -z "$ntpd_chrootdir" ]; then 26 | return 0; 27 | fi 28 | 29 | rc_flags="-u ntpd:ntpd -i ${ntpd_chrootdir} $rc_flags" 30 | } 31 | 32 | run_rc_command "$1" 33 | -------------------------------------------------------------------------------- /scripts/rc/rc.d/ntpwait: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This script, when run, runs ntp-wait if ntpd is enabled. 3 | 4 | # PROVIDE: ntpwait 5 | 6 | . /etc/rc.subr 7 | 8 | name="ntpwait" 9 | rcvar="ntpwait_enable" 10 | start_cmd="ntpwait_start" 11 | ntp_wait="/usr/sbin/ntp-wait" 12 | 13 | load_rc_config "$name" 14 | 15 | ntpwait_start() { 16 | if checkyesno ntpd_enable; then 17 | $ntp_wait -v 18 | fi 19 | } 20 | 21 | run_rc_command "$1" 22 | -------------------------------------------------------------------------------- /scripts/rc1/postinstall: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/scripts/rc1/postinstall -------------------------------------------------------------------------------- /scripts/rc1/preinstall: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/scripts/rc1/preinstall -------------------------------------------------------------------------------- /scripts/rc1/preremove: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/scripts/rc1/preremove -------------------------------------------------------------------------------- /scripts/rc1/prototype: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/scripts/rc1/prototype -------------------------------------------------------------------------------- /scripts/rc1/xntp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/scripts/rc1/xntp -------------------------------------------------------------------------------- /scripts/rc2/local.ntpd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/scripts/rc2/local.ntpd -------------------------------------------------------------------------------- /scripts/stats/dupe.awk: -------------------------------------------------------------------------------- 1 | # 2 | # delete duplicate lines 3 | # 4 | { 5 | if (old != $0) 6 | printf "%s\n", $0 7 | old = $0 8 | } 9 | -------------------------------------------------------------------------------- /scripts/stats/ensemble.S: -------------------------------------------------------------------------------- 1 | ensemble <- scan(file1, list(day=0, sec=0, gps=0, gpsw=0, loran=0, loranw=0, ensemble=0, std=0)) 2 | str <- paste("eps/", file1, ".eps", sep="") 3 | postscript(str, , , , 5, pointsize=18) 4 | par(mgp=c(1, 0, 0), tck = 0.03, mar = c(2, 2, 1, 1)) 5 | plot(ensemble$sec, ensemble$ensemble, type="l", xlab=paste("MJD", ensemble$day, "Time (s)"), ylab="Ensemble Offset (ns)", ylim=c(-400, 400)) 6 | -------------------------------------------------------------------------------- /scripts/stats/ensemble.awk: -------------------------------------------------------------------------------- 1 | # program to produce loran ensemble statistics from clockstats files 2 | # 3 | # usage: awk -f ensemble.awk clockstats 4 | # 5 | # format of input record (time values in seconds) 6 | # 49165 8.628 127.127.10.1 93:178:00:00:07.241 LORAN ENSEMBLE 7 | # -6.43E-08 +5.02E-08 .091 +5.98E-08 +1.59E-08 .909 +4.85E-08 +3.52E-08 8 | # 9 | # format of output record (time values in nanoseconds) 10 | # MJD sec GPS wgt LORAN wgt avg sigma 11 | # 49165 8.628 -64.3 0.091 59.8 0.909 48.5 35.2 12 | # 13 | # select LORAN ENSEMBLE records with valid format and weights 14 | { 15 | if (NF >= 14 && $6 == "ENSEMBLE" && $9 > 0 && $12 > 0) 16 | 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 17 | } 18 | -------------------------------------------------------------------------------- /scripts/stats/etf.S: -------------------------------------------------------------------------------- 1 | options(digits=4) 2 | file2 <- "etf_summary" 3 | etf <- scan(file1, list(day=0, sec=0, offset=0, stab=0)) 4 | r <- lsfit(etf$sec, etf$offset) 5 | count<-length(etf$sec) 6 | mean<-r$coef[[1]] 7 | std<-sqrt(var(r$residuals)) 8 | slope<-r$coef[[2]] * 1000 9 | cat("\n", file=file2 , append=TRUE, fill=FALSE, sep="") 10 | cat(file1, "\n", file=file2, append=TRUE, fill=FALSE, sep="") 11 | cat("etf1 ", count, ", T ", mean, " ns, R ", slope, " ps/s, std ", std, " us\n", file=file2, append=TRUE, fill=FALSE, sep="") 12 | str <- paste("eps/", file1, ".eps", sep="") 13 | postscript(str, , , , 5, pointsize=18) 14 | par(mgp=c(1, 0, 0), tck=0.03, mar=c(2, 2, 1, 1)) 15 | plot(etf$sec, etf$offset, type="l", xlab=paste("MJD", etf$day, "Time (s)"), ylab="External Offset (ns)", ylim=c(-400, 400)) 16 | -------------------------------------------------------------------------------- /scripts/stats/etf.awk: -------------------------------------------------------------------------------- 1 | # program to produce external time/frequence statistics from clockstats files 2 | # 3 | # usage: awk -f etf.awk clockstats 4 | # 5 | # format of input record 6 | # 49165 40.473 127.127.10.1 93:178:00:00:39.238 ETF 7 | # +175.0 +176.8 2.0 +3.729E-11 +1.000E-10 +3.511E-11 4.005E-13 500 8 | # 9 | # format of output record (time values in nanoseconds) 10 | # MJD sec time freq 11 | # 49165 40.473 175.0 3.729e-11 12 | # 13 | # select ETF records with valid format 14 | { 15 | if (NF >= 9 && $5 == "ETF") { 16 | printf "%5s %9.3f %7.1f %10.3e\n", $1, $2, $6, $9 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /scripts/stats/itf.S: -------------------------------------------------------------------------------- 1 | itf <- scan(file1, list(day=0, sec=0, offset=0, stab=0)) 2 | str <- paste("eps/", file1, ".eps", sep="") 3 | postscript(str, , , , 5, pointsize=18) 4 | par(mgp=c(1, 0, 0), tck=0.03, mar=c(2, 2, 1, 1)) 5 | plot(itf$sec, itf$offset, type="l", xlab=paste("MJD", itf$day, "Time (s)"), ylab="Internal Offset (ns)", ylim=c(-400, 400)) 6 | -------------------------------------------------------------------------------- /scripts/stats/itf.awk: -------------------------------------------------------------------------------- 1 | # program to produce intewrnal time/frequence statistics from clockstats files 2 | # 3 | # usage: awk -f itf.awk clockstats 4 | # 5 | # format of input record 6 | # 49227 67.846 127.127.10.1 93:240:00:00:51.816 ITF 7 | # COCO 0 +2.0579E-07 -3.1037E-08 -7.7723E-11 +6.5455E-10 500.00 4.962819 8 | # 9 | # format of output record (time values in nanoseconds) 10 | # MJD sec time freq 11 | # 49227 67.846 +2.0579E-07 -7.7723E-11 12 | # 13 | # select ITF records with valid format 14 | { 15 | if (NF >= 10 && $5 == "ITF") { 16 | printf "%5s %9.3f %7.1f %10.3e\n", $1, $2, $8 * 1e9, $10 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /scripts/stats/loop.S: -------------------------------------------------------------------------------- 1 | options(digits=4) 2 | loop <- scan(file1, list(day=0, sec=0, offset=0, freq=0, tc=0)) 3 | loop$offset <- loop$offset * 1e6 4 | str <- paste("eps/", file1, ".eps", sep="") 5 | postscript(str, , , , 5, pointsize=18) 6 | par(mgp=c(1, 0, 0), tck=0.03, mar=c(2, 2, 1, 1)) 7 | plot(loop$sec, loop$offset, type="l", xlab=paste("MJD", loop$day, "Time (s)"), ylab="PLL Offset (us)", ylim=c(-400, 400)) 8 | -------------------------------------------------------------------------------- /scripts/stats/loop_summary: -------------------------------------------------------------------------------- 1 | 2 | loopstats.[1-9] 3 | -------------------------------------------------------------------------------- /scripts/stats/tdata.S: -------------------------------------------------------------------------------- 1 | tdata <- scan(file1, list(day=0, sec=0, m=0, w=0, x=0, y=0, z=0)) 2 | str <- paste("eps/", file1, ".eps", sep="") 3 | postscript(str, , , , 5, pointsize=18) 4 | par(mgp=c(1, 0, 0), tck=0.03, mar=c(2, 2, 1, 1)) 5 | plot(tdata$sec, tdata$m, type="l", xlab=paste("MJD", tdata$day, "Time (s)"), ylab="LORAN-M SNR (dB)") 6 | -------------------------------------------------------------------------------- /scripts/summary.texi: -------------------------------------------------------------------------------- 1 | \input texinfo @c -*-texinfo-*- 2 | @c %**start of header 3 | @setfilename summary.info 4 | @settitle Summary User's Manual 5 | @include ../sntp/include/version.texi 6 | @paragraphindent 2 7 | @c %**end of header 8 | 9 | @ifinfo 10 | This file documents the use of @code{summary}, 11 | a program from the NTP Project 12 | @end ifinfo 13 | 14 | @direntry 15 | * summary: (summary). Summarize (something) 16 | @end direntry 17 | 18 | @titlepage 19 | @title summary User's Manual 20 | @subtitle summary, version @value{VERSION}, @value{UPDATED} 21 | @c @author Max @email{foo@ntp.org} 22 | @end titlepage 23 | 24 | @c @page 25 | @c @vskip 0pt plus 1filll 26 | 27 | @node Top, summary Description, (dir), (dir) 28 | @top Summary User Manual 29 | 30 | This document describes the use of the NTP Project's @code{summary} program. 31 | This document applies to version @value{VERSION} of @code{summary}. 32 | 33 | @shortcontents 34 | 35 | @menu 36 | * summary Description:: Description 37 | * summary Invocation:: Invoking summary 38 | @end menu 39 | 40 | @include invoke-summary.texi 41 | -------------------------------------------------------------------------------- /scripts/t/1_common.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | use Test::More tests => 30; 4 | use Test::Command; 5 | use List::MoreUtils qw(any); 6 | 7 | my @script_list = qw( 8 | calc_tickadj/calc_tickadj ntp-wait/ntp-wait ntpsweep/ntpsweep 9 | ntptrace/ntptrace summary plot_summary 10 | ); 11 | 12 | for my $script (@script_list) { 13 | fail("$script not a regular file") if (!-f $script); 14 | pass("$script is a regular file"); 15 | fail("$script not an executabe") if (!-x $script); 16 | pass("$script is an executable"); 17 | fail("$script is not readable") if (!-r $script); 18 | pass("$script is readable"); 19 | 20 | TODO: { 21 | #todo_skip "$script - Broken script/no perl", 2 22 | # if any { $script eq $_ } qw(freq_adj ntp-groper ntp-status plot_summary); 23 | 24 | require_ok("./$script"); 25 | cmd_is("./$script --rubbish", '', qr/^Unknown option:/, 1, 26 | "$script reports unkown option"); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /scripts/t/plot_summary.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | use Test::More tests => 1; 4 | use Test::Util qw(check_help); 5 | 6 | my $script_name = "plot_summary"; 7 | 8 | my @options = ( 9 | [qw(directory=str)], 10 | [qw(identifier=str)], 11 | [qw(output-file=str)], 12 | [qw(plot-term=str)], 13 | [qw(dont-wait)], 14 | [qw(offset-limit=float)], 15 | ); 16 | 17 | check_help("./$script_name", @options); 18 | -------------------------------------------------------------------------------- /scripts/t/summary.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | use Test::More tests => 1; 4 | use Test::Util qw(check_help); 5 | 6 | my $script_name = "summary"; 7 | 8 | my @options = ( 9 | [qw(directory=str)], 10 | [qw(end-date=num)], 11 | [qw(output-directory=str)], 12 | [qw(peer-dist-limit=float)], 13 | [qw(skip-time-steps=float)], 14 | [qw(start-date=num)], 15 | ); 16 | 17 | check_help("./$script_name", @options); 18 | -------------------------------------------------------------------------------- /scripts/update-leap/invoke-update-leap.menu: -------------------------------------------------------------------------------- 1 | * update-leap Invocation:: Invoking update-leap 2 | -------------------------------------------------------------------------------- /sntp/check-libntp.mf: -------------------------------------------------------------------------------- 1 | ## check-libntp.mf - automake fragment 2 | ## 3 | ## tests/libntp/Makefile.am 4 | ## sntp/tests/Makefile.am 5 | ## The above files have adaptations of this for deeper nesting. 6 | 7 | BUILT_SOURCES += check-libntp 8 | CLEANFILES += check-libntp 9 | 10 | check-libntp: ../libntp/libntp.a 11 | @echo stamp > $@ 12 | 13 | ../libntp/libntp.a: 14 | cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a 15 | 16 | -------------------------------------------------------------------------------- /sntp/check-libopts.mf: -------------------------------------------------------------------------------- 1 | ## check-libopts.mf - automake fragment 2 | ## 3 | ## If we are not using the tearoff libopts, we won't be 4 | ## building its libopts.la, so the submake is allowed 5 | ## to fail. 6 | 7 | BUILT_SOURCES += check-libopts 8 | CLEANFILES += check-libopts 9 | 10 | check-libopts: libopts/libopts.la 11 | @echo stamp > $@ 12 | 13 | libopts/libopts.la: 14 | -cd libopts && $(MAKE) $(AM_MAKEFLAGS) libopts.la 15 | -------------------------------------------------------------------------------- /sntp/crypto.h: -------------------------------------------------------------------------------- 1 | #ifndef CRYPTO_H 2 | #define CRYPTO_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include /* provides OpenSSL digest API */ 12 | #include "utilities.h" 13 | #include "sntp-opts.h" 14 | 15 | #define LEN_PKT_MAC LEN_PKT_NOMAC + sizeof(u_int32) 16 | 17 | /* #include "sntp-opts.h" */ 18 | 19 | struct key { 20 | struct key * next; 21 | int key_id; 22 | int key_len; 23 | char type[10]; 24 | char key_seq[64]; 25 | }; 26 | 27 | extern int auth_init(const char *keyfile, struct key **keys); 28 | extern void get_key(int key_id, struct key **d_key); 29 | extern int make_mac(const void *pkt_data, int pkt_size, int mac_size, 30 | const struct key *cmp_key, void *digest); 31 | extern int auth_md5(const void *pkt_data, int pkt_size, int mac_size, 32 | const struct key *cmp_key); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /sntp/data_formats.h: -------------------------------------------------------------------------------- 1 | #ifndef DATA_FORMATS_H 2 | #define DATA_FORMATS_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /sntp/deps-ver: -------------------------------------------------------------------------------- 1 | Mon Jan 31 21:14:29 UTC 2011 2 | -------------------------------------------------------------------------------- /sntp/fetch-stubs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | set -x 4 | 5 | test -f bincheck.mf || cp ../bincheck.mf . 6 | test -f autogen-version.def || cp ../include/autogen-version.def . 7 | test -f version.def || cp ../include/version.def . 8 | test -f version.m4 || cp ../version.m4 . 9 | -------------------------------------------------------------------------------- /sntp/include/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL = 2 | 3 | EXTRA_DIST = \ 4 | autogen-version.def \ 5 | copyright.def \ 6 | debug-opt.def \ 7 | homerc.def \ 8 | ntp.lic \ 9 | version.def \ 10 | version.texi \ 11 | $(NULL) 12 | 13 | noinst_HEADERS = 14 | 15 | $(srcdir)/version.def: $(srcdir)/../../packageinfo.sh 16 | cd .. && $(MAKE) $(AM_MAKEFLAGS) $(abs_top_srcdir)/include/version.def 17 | 18 | $(srcdir)/version.texi: $(srcdir)/../../packageinfo.sh 19 | cd .. && $(MAKE) $(AM_MAKEFLAGS) $(abs_top_srcdir)/include/version.texi 20 | -------------------------------------------------------------------------------- /sntp/include/autogen-version.def: -------------------------------------------------------------------------------- 1 | #assert (version-compare >= autogen-version "5.18.5") 2 | // >= is usually what we want. 3 | // > is when we need a pre* version 4 | guard-option-names; 5 | -------------------------------------------------------------------------------- /sntp/include/copyright.def: -------------------------------------------------------------------------------- 1 | /* -*- Mode: Text -*- */ 2 | 3 | copyright = { 4 | date = "1992-2016"; 5 | owner = "The University of Delaware and Network Time Foundation"; 6 | eaddr = "http://bugs.ntp.org, bugs@ntp.org"; 7 | type = ntp; 8 | }; 9 | 10 | long-opts; 11 | config-header = config.h; 12 | environrc; 13 | no-misuse-usage; 14 | version-proc = ntpOptionPrintVersion; 15 | 16 | version = ` 17 | eval VERSION=\`sed -e 's/.*,\\[//' -e 's/\\].*//' < ../sntp/m4/version.m4\` 18 | [ -z "${VERSION}" ] && echo "Cannot determine VERSION" && kill -TERM $AG_pid 19 | echo $VERSION`; 20 | 21 | version-value = ''; /* Don't use -v as a shortcut for --version */ 22 | 23 | /* 24 | * HMS: man pages already have this, and texi pages can use the 25 | * values in sntp/include/version.texi . 26 | */ 27 | // doc-sub = { 28 | // sub-name = version; 29 | // sub-text = 's/#VERSION#/<>/g'; 30 | // }; 31 | -------------------------------------------------------------------------------- /sntp/include/debug-opt.def: -------------------------------------------------------------------------------- 1 | 2 | include = <<- _EOF_ 3 | #ifdef __windows 4 | extern int atoi(const char*); 5 | #else 6 | # include 7 | #endif 8 | _EOF_; 9 | 10 | flag = { 11 | name = debug-level; 12 | value = d; 13 | max = NOLIMIT; 14 | nopreset; 15 | flag-code = 'OPT_VALUE_SET_DEBUG_LEVEL++;'; 16 | descrip = "Increase debug verbosity level"; 17 | doc = <<- _EndOfDoc_ 18 | _EndOfDoc_; 19 | }; 20 | 21 | flag = { 22 | name = set-debug-level; 23 | value = D; 24 | max = NOLIMIT; 25 | descrip = "Set the debug verbosity level"; 26 | arg-type = number; 27 | doc = <<- _EndOfDoc_ 28 | _EndOfDoc_; 29 | }; 30 | -------------------------------------------------------------------------------- /sntp/include/homerc.def: -------------------------------------------------------------------------------- 1 | /* -*- Mode: Text -*- */ 2 | 3 | #ifndef __windows__ 4 | rcfile = ".ntprc"; 5 | #else 6 | rcfile = "ntp.ini"; 7 | #endif 8 | 9 | homerc = $HOME, "."; 10 | -------------------------------------------------------------------------------- /sntp/include/ntp.lic: -------------------------------------------------------------------------------- 1 | Copyright (C) , all rights reserved. 2 | This is free software. It is licensed for use, modification and 3 | redistribution under the terms of the NTP License, copies of which 4 | can be seen at: 5 | 6 | 7 | 8 | Permission to use, copy, modify, and distribute this software and its 9 | documentation for any purpose with or without fee is hereby granted, 10 | provided that the above copyright notice appears in all copies and that 11 | both the copyright notice and this permission notice appear in 12 | supporting documentation, and that the name The University of Delaware not be used in 13 | advertising or publicity pertaining to distribution of the software 14 | without specific, written prior permission. makes no 15 | representations about the suitability this software for any purpose. It 16 | is provided "as is" without express or implied warranty. 17 | 18 | the NTP license, 19 | -------------------------------------------------------------------------------- /sntp/includes.mf: -------------------------------------------------------------------------------- 1 | ## includes.mf - automake fragment 2 | 3 | SNTP_INCS = -I$(top_srcdir)/../include 4 | SNTP_INCS += -I$(top_srcdir)/../lib/isc/include 5 | SNTP_INCS += -I$(top_srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include 6 | SNTP_INCS += -I$(top_srcdir)/../lib/isc/unix/include 7 | -------------------------------------------------------------------------------- /sntp/invoke-sntp.menu: -------------------------------------------------------------------------------- 1 | * sntp Invocation:: Invoking sntp 2 | -------------------------------------------------------------------------------- /sntp/kod_management.h: -------------------------------------------------------------------------------- 1 | #ifndef KOD_MANAGEMENT_H 2 | #define KOD_MANAGEMENT_H 3 | 4 | #include 5 | 6 | struct kod_entry { 7 | char hostname[255]; 8 | time_t timestamp; 9 | char type[5]; 10 | }; 11 | 12 | int search_entry(const char *hostname, struct kod_entry **dst); 13 | void add_entry(const char *hostname, const char *type); 14 | void delete_entry(const char *hostname, const char *type); 15 | void kod_init_kod_db(const char *db_file, int readonly); 16 | int write_kod_db(void); 17 | void atexit_write_kod_db(void); 18 | 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /sntp/libevent/WIN32-Code/getopt.h: -------------------------------------------------------------------------------- 1 | #ifndef __GETOPT_H__ 2 | #define __GETOPT_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | extern int opterr; /* if error message should be printed */ 9 | extern int optind; /* index into parent argv vector */ 10 | extern int optopt; /* character checked for validity */ 11 | extern int optreset; /* reset getopt */ 12 | extern char *optarg; /* argument associated with option */ 13 | 14 | struct option 15 | { 16 | const char *name; 17 | int has_arg; 18 | int *flag; 19 | int val; 20 | }; 21 | 22 | #define no_argument 0 23 | #define required_argument 1 24 | #define optional_argument 2 25 | 26 | int getopt(int, char**, const char*); 27 | int getopt_long(int, char**, const char*, const struct option*, int*); 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif /* __GETOPT_H__ */ 34 | -------------------------------------------------------------------------------- /sntp/libevent/WIN32-Code/nmake/evconfig-private.h: -------------------------------------------------------------------------------- 1 | #if !defined(EVENT_EVCONFIG__PRIVATE_H_) && !defined(__MINGW32__) 2 | #define EVENT_EVCONFIG__PRIVATE_H_ 3 | 4 | /* Nothing to see here. Move along. */ 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /sntp/libevent/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ -x "`which autoreconf 2>/dev/null`" ] ; then 3 | exec autoreconf -ivf 4 | fi 5 | 6 | LIBTOOLIZE=libtoolize 7 | SYSNAME=`uname` 8 | if [ "x$SYSNAME" = "xDarwin" ] ; then 9 | LIBTOOLIZE=glibtoolize 10 | fi 11 | aclocal -I m4 && \ 12 | autoheader && \ 13 | $LIBTOOLIZE && \ 14 | autoconf && \ 15 | automake --add-missing --force-missing --copy 16 | -------------------------------------------------------------------------------- /sntp/libevent/libevent.pc.in: -------------------------------------------------------------------------------- 1 | #libevent pkg-config source file 2 | 3 | prefix=@prefix@ 4 | exec_prefix=@exec_prefix@ 5 | libdir=@libdir@ 6 | includedir=@includedir@ 7 | 8 | Name: libevent 9 | Description: libevent is an asynchronous notification event loop library 10 | Version: @VERSION@ 11 | Requires: 12 | Conflicts: 13 | Libs: -L${libdir} -levent 14 | Libs.private: @LIBS@ 15 | Cflags: -I${includedir} 16 | 17 | -------------------------------------------------------------------------------- /sntp/libevent/libevent_openssl.pc.in: -------------------------------------------------------------------------------- 1 | #libevent pkg-config source file 2 | 3 | prefix=@prefix@ 4 | exec_prefix=@exec_prefix@ 5 | libdir=@libdir@ 6 | includedir=@includedir@ 7 | 8 | Name: libevent_openssl 9 | Description: libevent_openssl adds openssl-based TLS support to libevent 10 | Version: @VERSION@ 11 | Requires: libevent 12 | Conflicts: 13 | Libs: -L${libdir} -levent_openssl 14 | Libs.private: @LIBS@ @OPENSSL_LIBS@ 15 | Cflags: -I${includedir} @OPENSSL_INCS@ 16 | 17 | -------------------------------------------------------------------------------- /sntp/libevent/libevent_pthreads.pc.in: -------------------------------------------------------------------------------- 1 | #libevent pkg-config source file 2 | 3 | prefix=@prefix@ 4 | exec_prefix=@exec_prefix@ 5 | libdir=@libdir@ 6 | includedir=@includedir@ 7 | 8 | Name: libevent_pthreads 9 | Description: libevent_pthreads adds pthreads-based threading support to libevent 10 | Version: @VERSION@ 11 | Requires: libevent 12 | Conflicts: 13 | Libs: -L${libdir} -levent_pthreads 14 | Libs.private: @LIBS@ @PTHREAD_LIBS@ 15 | Cflags: -I${includedir} @PTHREAD_CFLAGS@ 16 | 17 | -------------------------------------------------------------------------------- /sntp/libevent/m4/ac_backport_259_ssizet.m4: -------------------------------------------------------------------------------- 1 | AN_IDENTIFIER([ssize_t], [AC_TYPE_SSIZE_T]) 2 | AC_DEFUN([AC_TYPE_SSIZE_T], [AC_CHECK_TYPE(ssize_t, int)]) 3 | 4 | -------------------------------------------------------------------------------- /sntp/libevent/m4/ntp_pkg_config.m4: -------------------------------------------------------------------------------- 1 | dnl NTP_PKG_CONFIG -*- Autoconf -*- 2 | dnl 3 | dnl Look for pkg-config, which must be at least 4 | dnl $ntp_pkgconfig_min_version. 5 | dnl 6 | AC_DEFUN([NTP_PKG_CONFIG], [ 7 | 8 | dnl lower the minimum version if you find an earlier one works 9 | ntp_pkgconfig_min_version='0.15.0' 10 | AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 11 | AS_UNSET([ac_cv_path_PKG_CONFIG]) 12 | AS_UNSET([ac_cv_path_ac_pt_PKG_CONFIG]) 13 | 14 | case "$PKG_CONFIG" in 15 | /*) 16 | AC_MSG_CHECKING([if pkg-config is at least version $ntp_pkgconfig_min_version]) 17 | if $PKG_CONFIG --atleast-pkgconfig-version $ntp_pkgconfig_min_version; then 18 | AC_MSG_RESULT([yes]) 19 | else 20 | AC_MSG_RESULT([no]) 21 | PKG_CONFIG="" 22 | fi 23 | ;; 24 | esac 25 | 26 | ]) dnl NTP_PKG_CONFIG 27 | 28 | -------------------------------------------------------------------------------- /sntp/libevent/make-event-config.sed: -------------------------------------------------------------------------------- 1 | # Sed script to postprocess config.h into event-config.h. 2 | 3 | 1i\ 4 | /* event2/event-config.h\ 5 | *\ 6 | * This file was generated by autoconf when libevent was built, and post-\ 7 | * processed by Libevent so that its macros would have a uniform prefix.\ 8 | *\ 9 | * DO NOT EDIT THIS FILE.\ 10 | *\ 11 | * Do not rely on macros in this file existing in later versions.\ 12 | */\ 13 | \ 14 | #ifndef EVENT2_EVENT_CONFIG_H_INCLUDED_\ 15 | #define EVENT2_EVENT_CONFIG_H_INCLUDED_\ 16 | 17 | $a\ 18 | \ 19 | #endif /* event2/event-config.h */ 20 | 21 | s/#\( *\)define /#\1define EVENT__/ 22 | s/#\( *\)undef /#\1undef EVENT__/ 23 | s/#\( *\)if\(n*\)def /#\1if\2def EVENT__/ 24 | -------------------------------------------------------------------------------- /sntp/libevent/strlcpy-internal.h: -------------------------------------------------------------------------------- 1 | #ifndef STRLCPY_INTERNAL_H_INCLUDED_ 2 | #define STRLCPY_INTERNAL_H_INCLUDED_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include "event2/event-config.h" 9 | #include "evconfig-private.h" 10 | 11 | #ifndef EVENT__HAVE_STRLCPY 12 | #include 13 | size_t event_strlcpy_(char *dst, const char *src, size_t siz); 14 | #define strlcpy event_strlcpy_ 15 | #endif 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /sntp/libevent/test/regress.rpc: -------------------------------------------------------------------------------- 1 | /* tests data packing and unpacking */ 2 | 3 | struct msg { 4 | string /* sender */ from_name = 1; /* be verbose */ 5 | string to_name = 2; 6 | optional struct[kill] attack = 3; 7 | array struct[run] run = 4; 8 | } 9 | 10 | struct kill { 11 | string weapon = 0x10121; 12 | string action = 2; 13 | array int how_often = 3; 14 | } 15 | 16 | struct run { 17 | string how = 1; 18 | optional bytes some_bytes = 2; 19 | 20 | bytes fixed_bytes[24] = 3; 21 | array string notes = 4; 22 | 23 | optional int64 large_number = 5; 24 | array int other_numbers = 6; 25 | } 26 | -------------------------------------------------------------------------------- /sntp/libevent/test/tinytest_local.h: -------------------------------------------------------------------------------- 1 | 2 | #include "util-internal.h" 3 | #ifdef _WIN32 4 | #include 5 | #endif 6 | 7 | #include "event2/util.h" 8 | 9 | #ifdef snprintf 10 | #undef snprintf 11 | #endif 12 | #define snprintf evutil_snprintf 13 | -------------------------------------------------------------------------------- /sntp/libopts/MakeDefs.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/sntp/libopts/MakeDefs.inc -------------------------------------------------------------------------------- /sntp/libopts/compat/_Noreturn.h: -------------------------------------------------------------------------------- 1 | #if !defined _Noreturn && __STDC_VERSION__ < 201112 2 | # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ 3 | || 0x5110 <= __SUNPRO_C) 4 | # define _Noreturn __attribute__ ((__noreturn__)) 5 | # elif 1200 <= _MSC_VER 6 | # define _Noreturn __declspec (noreturn) 7 | # else 8 | # define _Noreturn 9 | # endif 10 | #endif 11 | -------------------------------------------------------------------------------- /sntp/libopts/compat/strdup.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Platforms without strdup ?!?!?! 3 | */ 4 | 5 | static char * 6 | strdup( char const *s ); 7 | 8 | static char * 9 | strdup( char const *s ) 10 | { 11 | char *cp; 12 | 13 | if (s == NULL) 14 | return NULL; 15 | 16 | cp = (char *) AGALOC((unsigned) (strlen(s)+1), "strdup"); 17 | 18 | if (cp != NULL) 19 | (void) strcpy(cp, s); 20 | 21 | return cp; 22 | } 23 | -------------------------------------------------------------------------------- /sntp/libopts/m4/liboptschk.m4: -------------------------------------------------------------------------------- 1 | # liboptschk.m4 serial 2 (autogen - 5.11.4) 2 | dnl Copyright (C) 2005-2015 by Bruce Korb - all rights reserved 3 | dnl 4 | dnl This file is free software; the Free Software Foundation 5 | dnl gives unlimited permission to copy and/or distribute it, 6 | dnl with or without modifications, as long as this notice is preserved. 7 | dnl 8 | AC_DEFUN([ag_FIND_LIBOPTS], 9 | [if test "X${ac_cv_header_autoopts_options_h}" = Xno 10 | then : 11 | else 12 | f=`autoopts-config cflags` 2>/dev/null 13 | if test X"${f}" = X 14 | then 15 | : 16 | else 17 | AC_DEFINE([HAVE_LIBOPTS],[1],[define if we can find libopts]) 18 | CFLAGS="${CFLAGS} ${f}" 19 | ao_CFLAGS="${f}" 20 | AC_SUBST(ao_CFLAGS) 21 | 22 | f=`autoopts-config ldflags` 2>/dev/null 23 | LIBS="${LIBS} ${f}" 24 | ao_LIBS="${f}" 25 | AC_SUBST(ao_LIBS) 26 | fi 27 | fi]) 28 | -------------------------------------------------------------------------------- /sntp/libpkgver/pkgver.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2015 Harlan Stenn. Used by NTP with permission. 4 | * 5 | * Author: Harlan Stenn 6 | * 7 | * Copying and distribution of this file, with or without modification, are 8 | * permitted in any medium without royalty provided the copyright notice 9 | * and this notice are preserved. This file is offered as-is, without any 10 | * warranty. 11 | */ 12 | 13 | extern int colcomp(char *s1, char *s2); 14 | 15 | #define PKG_VER_LT(x) (colcomp((x), PACKAGE_VERSION) < 0) 16 | #define PKG_VER_LE(x) (colcomp((x), PACKAGE_VERSION) <= 0) 17 | #define PKG_VER_EQ(x) (colcomp((x), PACKAGE_VERSION) == 0) 18 | #define PKG_VER_GE(x) (colcomp((x), PACKAGE_VERSION) >= 0) 19 | #define PKG_VER_GT(x) (colcomp((x), PACKAGE_VERSION) > 0) 20 | -------------------------------------------------------------------------------- /sntp/loc/README: -------------------------------------------------------------------------------- 1 | If you look at the files here you should be able to figure out what is 2 | being done. 3 | 4 | ../scripts/genLocInfo handles the parsing of these files. 5 | 6 | If no "more specific" file has been found and cvo.sh says the OS is 7 | redhat* or fedora*, we will look for loc/redhat . 8 | 9 | If no "mode specific" file has been found and the "uname" command returns 10 | "Linux", we will look for loc/linux . 11 | 12 | Note that automake has interesting behavior - we build the man pages using 13 | the man_MANS target, but they are actually installed using the empty 14 | manX_MANS= target, which "does the right thing". This means that we 15 | need to have empty manX_MANS= targets for each possible X, based on 16 | the data in the loc/ files. For executables, this generally means 17 | sections 1 and 8. 18 | -------------------------------------------------------------------------------- /sntp/loc/darwin: -------------------------------------------------------------------------------- 1 | # Darwin (Mac OS X) installations and man page suffixes 2 | MDOC 3 | ntp-keygen,bin,8 4 | ntp-wait,sbin,8 5 | ntpd,sbin,8 6 | ntpdate,sbin,8 7 | ntpdc,sbin,8 8 | ntpdsim,sbin,8 9 | ntpq,bin,8 10 | ntpsnmpd,sbin,8 11 | ntpsweep,noinst,8 12 | ntptime,sbin,8 13 | ntptrace,sbin,8 14 | sntp,bin,8 15 | update-leap,sbin,8 16 | -------------------------------------------------------------------------------- /sntp/loc/debian: -------------------------------------------------------------------------------- 1 | # Debian installations and man page suffixes 2 | MDOC 3 | calc_tickadj,sbin,8 4 | ntp-keygen,sbin,8 5 | ntp-wait,sbin,8 6 | ntpd,sbin,8 7 | ntpdate,sbin,8 8 | ntpdc,bin,1 9 | ntpdsim,sbin,8 10 | ntpq,bin,1 11 | ntpsnmpd,sbin,8 12 | ntpsweep,bin,1 13 | ntptime,sbin,8 14 | ntptrace,bin,1 15 | sntp,bin,1 16 | tickadj,sbin,8 17 | timetrim,sbin,8 18 | update-leap,sbin,8 19 | -------------------------------------------------------------------------------- /sntp/loc/freebsd: -------------------------------------------------------------------------------- 1 | # FreeBSD installations and man page suffixes 2 | MDOC 3 | ntp-keygen,sbin,8 4 | ntp-wait,sbin,8 5 | ntpd,sbin,8 6 | ntpdate,sbin,8 7 | ntpdc,sbin,8 8 | ntpdsim,sbin,8 9 | ntpq,sbin,8 10 | ntpsnmpd,sbin,8 11 | ntptime,sbin,8 12 | ntpsweep,noinst,8 13 | ntptrace,sbin,8 14 | sntp,sbin,8 15 | update-leap,sbin,8 16 | -------------------------------------------------------------------------------- /sntp/loc/legacy: -------------------------------------------------------------------------------- 1 | # Legacy installations and man page suffixes 2 | MAN 3 | calc_tickadj,bin,1 4 | ntp-keygen,bin,1 5 | ntp-wait,bin,1 6 | ntpd,bin,1 7 | ntpdate,bin,1 8 | ntpdc,bin,1 9 | ntpdsim,bin,1 10 | ntpq,bin,1 11 | ntpsnmpd,bin,1 12 | ntpsweep,noinst,1 13 | ntptime,bin,1 14 | ntptrace,bin,1 15 | sntp,bin,1 16 | tickadj,bin,1 17 | timetrim,bin,1 18 | update-leap,bin,1 19 | -------------------------------------------------------------------------------- /sntp/loc/netbsd: -------------------------------------------------------------------------------- 1 | # NetBSD installations and man page suffixes 2 | MDOC 3 | ntp-keygen,sbin,8 4 | ntp-wait,sbin,8 5 | ntpd,sbin,8 6 | ntpdate,sbin,8 7 | ntpdc,sbin,8 8 | ntpdsim,sbin,8 9 | ntpq,sbin,8 10 | ntpsnmpd,sbin,8 11 | ntpsweep,noinst,8 12 | ntptime,sbin,8 13 | ntptrace,sbin,8 14 | sntp,sbin,1 15 | update-leap,sbin,8 16 | -------------------------------------------------------------------------------- /sntp/loc/redhat: -------------------------------------------------------------------------------- 1 | # RedHat/Fedora installations and man page suffixes 2 | MAN 3 | calc_tickadj,sbin,8 4 | ntp-keygen,sbin,8 5 | ntp-wait,sbin,8 6 | ntpd,sbin,8 7 | ntpdate,sbin,8 8 | ntpdc,sbin,8 9 | ntpdsim,sbin,8 10 | ntpq,sbin,8 11 | ntpsnmpd,sbin,8 12 | ntpsweep,noinst,8 13 | ntptime,sbin,8 14 | ntptrace,sbin,8 15 | sntp,sbin,8 16 | tickadj,sbin,8 17 | timetrim,sbin,8 18 | -------------------------------------------------------------------------------- /sntp/loc/solaris: -------------------------------------------------------------------------------- 1 | # Solaris installations and man page suffixes 2 | MAN 3 | calc_tickadj,sbin,1m 4 | ntp-keygen,sbin,1m 5 | ntp-wait,libexec,1m 6 | ntpd,libexec,1m 7 | ntpdate,sbin,1m 8 | ntpdc,sbin,1m 9 | ntpdsim,sbin,1m 10 | ntpq,sbin,1m 11 | ntpsnmpd,libexec,1m 12 | ntpsweep,noinst,1m 13 | ntptime,sbin,1m 14 | ntptrace,sbin,1m 15 | sntp,sbin,1m 16 | tickadj,sbin,1m 17 | update-leap,sbin,1m 18 | -------------------------------------------------------------------------------- /sntp/log.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "log.h" 4 | 5 | const char *progname; /* for msyslog use too */ 6 | 7 | static int counter = 0; 8 | 9 | static void cleanup_log(void); 10 | 11 | void 12 | sntp_init_logging( 13 | const char *prog 14 | ) 15 | { 16 | 17 | msyslog_term = TRUE; 18 | init_logging(prog, 0, FALSE); 19 | msyslog_term_pid = FALSE; 20 | msyslog_include_timestamp = FALSE; 21 | } 22 | 23 | 24 | void 25 | open_logfile( 26 | const char *logfile 27 | ) 28 | { 29 | change_logfile(logfile, FALSE); 30 | counter = 1; //counter++; 31 | atexit(cleanup_log); 32 | } 33 | 34 | //not sure about this. Are the atexit() functions called by FIFO or LIFO order? The end result is PROBABLY the same 35 | static void 36 | cleanup_log(void) 37 | { 38 | //counter--; 39 | //if(counter <= 0){ 40 | if(counter == 1){ 41 | syslogit = TRUE; 42 | fflush(syslog_file); 43 | fclose(syslog_file); 44 | syslog_file = NULL; 45 | counter = 0; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /sntp/log.h: -------------------------------------------------------------------------------- 1 | #ifndef LOG_H 2 | #define LOG_H 3 | 4 | #include "ntp.h" 5 | #include "ntp_stdlib.h" 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | /* syslog as ntpd does, even though we are not a daemon */ 13 | #ifdef LOG_NTP 14 | # define OPENLOG_FAC LOG_NTP 15 | #else 16 | # ifndef LOG_DAEMON 17 | # define LOG_DAEMON 0 18 | # endif 19 | # define OPENLOG_FAC LOG_DAEMON 20 | #endif 21 | 22 | void sntp_init_logging(const char *program); 23 | void open_logfile(const char *logfile); 24 | 25 | extern char const *progname; /* for msyslog use too */ 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /sntp/m4/hms_search_lib.m4: -------------------------------------------------------------------------------- 1 | dnl Helper function to manage granular libraries 2 | dnl 3 | dnl Usage: 4 | dnl 5 | dnl LIB_MATH='' 6 | dnl AC_SUBST([LIB_MATH]) 7 | dnl ... 8 | dnl HMS_SEARCH_LIBS([LIB_MATH], [sqrt], [m], [AIF], [AINF], [OL]) 9 | dnl 10 | dnl which expands to something like: 11 | dnl 12 | dnl AC_SEARCH_LIBS([sqrt], [m], [case "$ac_cv_search_sqrt" in 13 | dnl 'none required') ;; 14 | dnl no) ;; 15 | dnl *) LIB_MATH="$ac_cv_search_sqrt $LIB_MATH" ;; 16 | dnl esac 17 | dnl [AIF]], 18 | dnl [AINF], 19 | dnl [OL]) 20 | dnl 21 | dnl arguments are: lib-var, function, search-libs, [AIF], [AINF], [other-libs] 22 | AC_DEFUN([HMS_SEARCH_LIBS], 23 | [AC_SEARCH_LIBS([$2], [$3], [case "$ac_cv_search_$2[]" in 24 | 'none required') ;; 25 | no) ;; 26 | *) $1[]="$ac_cv_search_$2[] $[]$1" ;; 27 | esac 28 | $4], 29 | $5, 30 | [$6])]) 31 | -------------------------------------------------------------------------------- /sntp/m4/ntp_crosscompile.m4: -------------------------------------------------------------------------------- 1 | dnl ###################################################################### 2 | AC_DEFUN([NTP_CROSSCOMPILE], [ 3 | 4 | # Expose a cross-compilation indicator to makefiles 5 | AM_CONDITIONAL([NTP_CROSSCOMPILE], [test $build != $host]) 6 | 7 | ])dnl 8 | dnl ====================================================================== 9 | -------------------------------------------------------------------------------- /sntp/m4/ntp_debug.m4: -------------------------------------------------------------------------------- 1 | dnl ###################################################################### 2 | dnl Common m4sh code for debug 3 | AC_DEFUN([NTP_DEBUG], [ 4 | 5 | AC_MSG_CHECKING([if we're including debugging code]) 6 | AC_ARG_ENABLE( 7 | [debugging], 8 | [AS_HELP_STRING( 9 | [--enable-debugging], 10 | [+ include ntpd debugging code] 11 | )], 12 | [ntp_ok=$enableval], 13 | [ntp_ok=yes] 14 | ) 15 | case "$ntp_ok" in 16 | yes) 17 | AC_DEFINE([DEBUG], [1], [Enable debugging code?]) 18 | esac 19 | AC_MSG_RESULT([$ntp_ok]) 20 | 21 | ])dnl 22 | dnl ====================================================================== 23 | -------------------------------------------------------------------------------- /sntp/m4/ntp_dir_sep.m4: -------------------------------------------------------------------------------- 1 | dnl ###################################################################### 2 | dnl What directory path separator do we use? 3 | AC_DEFUN([NTP_DIR_SEP], [ 4 | AC_CACHE_CHECK( 5 | [for directory path separator], 6 | [ntp_cv_dir_sep], 7 | [ 8 | case "$ntp_cv_dir_sep" in 9 | '') 10 | case "$host_os" in 11 | *djgpp | *mingw32* | *emx*) 12 | ntp_cv_dir_sep="'\\'" 13 | ;; 14 | *) 15 | ntp_cv_dir_sep="'/'" 16 | ;; 17 | esac 18 | esac 19 | ] 20 | ) 21 | AC_DEFINE_UNQUOTED([DIR_SEP], [$ntp_cv_dir_sep], 22 | [Directory separator character, usually / or \\]) 23 | ]) 24 | dnl ====================================================================== 25 | -------------------------------------------------------------------------------- /sntp/m4/ntp_facilitynames.m4: -------------------------------------------------------------------------------- 1 | dnl ###################################################################### 2 | dnl Check syslog.h for 'facilitynames' table 3 | AC_DEFUN([NTP_FACILITYNAMES], [ 4 | AC_CACHE_CHECK([for facilitynames in syslog.h],ac_cv_HAVE_SYSLOG_FACILITYNAMES,[ 5 | AC_TRY_COMPILE([ 6 | #define SYSLOG_NAMES 7 | #include 8 | #include 9 | ], 10 | [ void *fnames; fnames = facilitynames; ], 11 | ac_cv_HAVE_SYSLOG_FACILITYNAMES=yes,ac_cv_HAVE_SYSLOG_FACILITYNAMES=no,ac_cv_HAVE_SYSLOG_FACILITYNAMES=cross)]) 12 | case "$ac_cv_HAVE_SYSLOG_FACILITYNAMES" in 13 | yes) 14 | AC_DEFINE(HAVE_SYSLOG_FACILITYNAMES,1,[ ]) 15 | ;; 16 | no) 17 | AC_MSG_WARN([No facilitynames in ]) 18 | ;; 19 | cross) 20 | AC_MSG_WARN([facilitynames in - cross-compiling]) 21 | ;; 22 | esac 23 | ]) 24 | dnl ====================================================================== 25 | -------------------------------------------------------------------------------- /sntp/m4/ntp_lib_m.m4: -------------------------------------------------------------------------------- 1 | dnl ###################################################################### 2 | dnl What do we need for math libraries? 3 | AC_DEFUN([NTP_LIB_M], [ 4 | LIBM= 5 | case "$host" in 6 | *-*-darwin*) 7 | ;; 8 | *) 9 | _libs=$LIBS 10 | AC_SEARCH_LIBS([cos], [m], [LIBM="-lm"]) 11 | LIBS=$_libs 12 | ;; 13 | esac 14 | AC_SUBST([LIBM]) 15 | AS_UNSET([_libs]) 16 | ]) 17 | dnl ====================================================================== 18 | -------------------------------------------------------------------------------- /sntp/m4/ntp_pkg_config.m4: -------------------------------------------------------------------------------- 1 | dnl NTP_PKG_CONFIG -*- Autoconf -*- 2 | dnl 3 | dnl Look for pkg-config, which must be at least 4 | dnl $ntp_pkgconfig_min_version. 5 | dnl 6 | AC_DEFUN([NTP_PKG_CONFIG], [ 7 | 8 | dnl lower the minimum version if you find an earlier one works 9 | ntp_pkgconfig_min_version='0.15.0' 10 | AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 11 | AS_UNSET([ac_cv_path_PKG_CONFIG]) 12 | AS_UNSET([ac_cv_path_ac_pt_PKG_CONFIG]) 13 | 14 | case "$PKG_CONFIG" in 15 | /*) 16 | AC_MSG_CHECKING([if pkg-config is at least version $ntp_pkgconfig_min_version]) 17 | if $PKG_CONFIG --atleast-pkgconfig-version $ntp_pkgconfig_min_version; then 18 | AC_MSG_RESULT([yes]) 19 | else 20 | AC_MSG_RESULT([no]) 21 | PKG_CONFIG="" 22 | fi 23 | ;; 24 | esac 25 | 26 | ]) dnl NTP_PKG_CONFIG 27 | 28 | -------------------------------------------------------------------------------- /sntp/m4/ntp_prog_cc.m4: -------------------------------------------------------------------------------- 1 | dnl ###################################################################### 2 | dnl NTP compiler basics 3 | dnl 4 | AC_DEFUN([NTP_PROG_CC], [ 5 | 6 | dnl must come before AC_PROG_CC or similar 7 | AC_USE_SYSTEM_EXTENSIONS 8 | 9 | dnl we need to check for cross compile tools for vxWorks here 10 | AC_PROG_CC 11 | # Ralf Wildenhues: With per-target flags we need CC_C_O 12 | # AM_PROG_CC_C_O supersets AC_PROG_CC_C_O 13 | AM_PROG_CC_C_O 14 | AC_PROG_GCC_TRADITIONAL 15 | NTP_COMPILER 16 | AC_C_BIGENDIAN 17 | AC_C_VOLATILE 18 | AC_PROG_CPP 19 | 20 | ])dnl 21 | dnl ====================================================================== 22 | -------------------------------------------------------------------------------- /sntp/m4/ntp_sntp.m4: -------------------------------------------------------------------------------- 1 | dnl ###################################################################### 2 | dnl Common m4sh code SNTP 3 | AC_DEFUN([NTP_WITHSNTP], [ 4 | 5 | dnl preset withsntp=no in env to change default to --without-sntp 6 | AC_MSG_CHECKING([if sntp will be built]) 7 | AC_ARG_WITH( 8 | [sntp], 9 | [AS_HELP_STRING( 10 | [--without-sntp], 11 | [- disable building sntp and sntp/tests] 12 | )], 13 | [], 14 | [with_sntp="${withsntp=yes}"] 15 | ) 16 | case "$with_sntp" in 17 | no) 18 | SNTP= 19 | ;; 20 | *) 21 | SNTP=sntp 22 | ;; 23 | esac 24 | AC_SUBST([SNTP]) 25 | AM_CONDITIONAL([BUILD_SNTP], [test -n "$SNTP"]) 26 | AC_MSG_RESULT([$with_sntp]) 27 | 28 | ])dnl 29 | dnl ====================================================================== 30 | -------------------------------------------------------------------------------- /sntp/m4/ntp_sysexits.m4: -------------------------------------------------------------------------------- 1 | dnl ###################################################################### 2 | dnl sysexits.h 3 | AC_DEFUN([NTP_SYSEXITS_H], [ 4 | 5 | AC_CHECK_HEADERS([sysexits.h], [],[ 6 | AC_DEFINE([EX_OK], [0], [successful termination]) 7 | AC_DEFINE([EX_SOFTWARE], [70], [internal software error]) 8 | ])dnl 9 | 10 | ])dnl 11 | dnl ====================================================================== 12 | -------------------------------------------------------------------------------- /sntp/m4/ntp_unitytest.m4: -------------------------------------------------------------------------------- 1 | dnl ###################################################################### 2 | dnl NTP_UNITYBUILD - Unity build support 3 | dnl shared by top-level and sntp/configure.ac 4 | AC_DEFUN([NTP_UNITYBUILD], [ 5 | # We may not need have_unity 6 | have_unity=false 7 | AC_PATH_PROG([PATH_RUBY], [ruby]) 8 | case "$PATH_RUBY" in 9 | /*) 10 | have_unity=true 11 | ;; 12 | *) PATH_RUBY="false" 13 | ;; 14 | esac 15 | # We may not need UNITYBUILD_AVAILABLE 16 | AM_CONDITIONAL([UNITYBUILD_AVAILABLE], [$have_unity]) 17 | 18 | ]) 19 | dnl ====================================================================== 20 | -------------------------------------------------------------------------------- /sntp/m4/ntp_ver_suffix.m4: -------------------------------------------------------------------------------- 1 | dnl #################################################################### 2 | dnl NTP Version Suffix (Crypto) 3 | dnl 4 | dnl Output substitutions: 5 | dnl VER_SUFFIX Version Suffix (scripts/mkver.in) 6 | dnl 7 | dnl #################################################################### 8 | AC_DEFUN([NTP_VER_SUFFIX], [ 9 | 10 | AC_SUBST([VER_SUFFIX]) 11 | VER_SUFFIX= 12 | ]) 13 | dnl ====================================================================== 14 | -------------------------------------------------------------------------------- /sntp/main.h: -------------------------------------------------------------------------------- 1 | #ifndef MAIN_H 2 | #define MAIN_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | 17 | #include "crypto.h" 18 | 19 | void set_li_vn_mode(struct pkt *spkt, char leap, char version, char mode); 20 | extern int sntp_main(int argc, char **argv, const char *); 21 | int generate_pkt(struct pkt *x_pkt, const struct timeval *tv_xmt, 22 | int key_id, struct key *pkt_key); 23 | int handle_pkt(int rpktl, struct pkt *rpkt, sockaddr_u *host, 24 | const char *hostname); 25 | void offset_calculation(struct pkt *rpkt, int rpktl, 26 | struct timeval *tv_dst, double *offset, 27 | double *precision, double *root_dispersion); 28 | int on_wire(struct addrinfo *host, struct addrinfo *bcastaddr); 29 | int set_time(double offset); 30 | 31 | #endif /* MAIN_H */ 32 | -------------------------------------------------------------------------------- /sntp/scripts/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL= 2 | 3 | EXTRA_DIST = \ 4 | cvo.sh \ 5 | genLocInfo \ 6 | mansec2subst.sed \ 7 | $(NULL) 8 | -------------------------------------------------------------------------------- /sntp/scripts/mansec2subst.sed: -------------------------------------------------------------------------------- 1 | s/1ntp-keygenman/@NTP_KEYGEN_MS@/g 2 | s/1ntp-keygenmdoc/@NTP_KEYGEN_MS@/g 3 | s/1ntp-waitman/@NTP_WAIT_MS@/g 4 | s/1ntp-waitmdoc/@NTP_WAIT_MS@/g 5 | s/1ntpdateman/@NTPDATE_MS@/g 6 | s/1ntpdatemdoc/@NTPDATE_MS@/g 7 | s/1ntpdcman/@NTPDC_MS@/g 8 | s/1ntpdcmdoc/@NTPDC_MS@/g 9 | s/1ntpdman/@NTPD_MS@/g 10 | s/1ntpdmdoc/@NTPD_MS@/g 11 | s/1ntpdsimman/@NTPDSIM_MS@/g 12 | s/1ntpdsimmdoc/@NTPDSIM_MS@/g 13 | s/1ntpqman/@NTPQ_MS@/g 14 | s/1ntpqmdoc/@NTPQ_MS@/g 15 | s/1ntpsnmpdman/@NTPSNMPD_MS@/g 16 | s/1ntpsnmpdmdoc/@NTPSNMPD_MS@/g 17 | s/1ntptimeman/@NTPTIME_MS@/g 18 | s/1ntptimemdoc/@NTPTIME_MS@/g 19 | s/1ntptraceman/@NTPTRACE_MS@/g 20 | s/1ntptracemdoc/@NTPTRACE_MS@/g 21 | s/1sntpman/@SNTP_MS@/g 22 | s/1sntpmdoc/@SNTP_MS@/g 23 | s/1tickadjman/@TICKADJ_MS@/g 24 | s/1tickadjmdoc/@TICKADJ_MS@/g 25 | s/1timetrimman/@TIMETRIM_MS@/g 26 | s/1timetrimmdoc/@TIMETRIM_MS@/g 27 | s/5man/5/g 28 | s/5mdoc/5/g 29 | -------------------------------------------------------------------------------- /sntp/sntp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "main.h" 4 | 5 | int 6 | main ( 7 | int argc, 8 | char ** argv 9 | ) 10 | { 11 | return sntp_main(argc, argv, Version); 12 | } 13 | -------------------------------------------------------------------------------- /sntp/tests/data/debug-input-lfp-bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- 2 | 0: 00000000 1: 00000000 2: 00000000 3: 00111111 4: 00000000 5: 00000000 6: 00000000 7: 01111111 3 | -------------------------------------------------------------------------------- 4 | -------------------------------------------------------------------------------- /sntp/tests/data/debug-input-lfp-dec: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- 2 | 0: 0 1: 0 2: 24 3: 166 4: 0 5: 4 6: 181 7: 22 3 | -------------------------------------------------------------------------------- 4 | -------------------------------------------------------------------------------- /sntp/tests/data/debug-input-pkt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- 2 | 0: 24 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0 3 | 8: 0 9: 0 10: 0 11: 0 12: 0 13: 0 14: 0 15: 0 4 | 16: 0 17: 0 18: 0 19: 0 20: 0 21: 0 22: 0 23: 0 5 | 24: 0 25: 0 26: 0 27: 0 28: 0 29: 0 30: 0 31: 0 6 | 32: 0 33: 0 34: 0 35: 0 36: 0 37: 0 38: 0 39: 0 7 | 40: 0 41: 0 42: 0 43: 8 44: 7f 45: ff 46: ff 47: ff 8 | -------------------------------------------------------------------------------- 9 | -------------------------------------------------------------------------------- /sntp/tests/data/debug-output-lfp-bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- 2 | 0: 00000000 1: 00000000 2: 00000000 3: 00111111 4: 00000000 5: 00000000 6: 00000000 7: 01111111 3 | -------------------------------------------------------------------------------- 4 | -------------------------------------------------------------------------------- /sntp/tests/data/debug-output-lfp-dec: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- 2 | 0: 0 1: 0 2: 24 3: 166 4: 0 5: 4 6: 181 7: 22 3 | -------------------------------------------------------------------------------- 4 | -------------------------------------------------------------------------------- /sntp/tests/data/debug-output-pkt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- 2 | 0: 24 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0 3 | 8: 0 9: 0 10: 0 11: 0 12: 0 13: 0 14: 0 15: 0 4 | 16: 0 17: 0 18: 0 19: 0 20: 0 21: 0 22: 0 23: 0 5 | 24: 0 25: 0 26: 0 27: 0 28: 0 29: 0 30: 0 31: 0 6 | 32: 0 33: 0 34: 0 35: 0 36: 0 37: 0 38: 0 39: 0 7 | 40: 0 41: 0 42: 0 43: 8 44: 7f 45: ff 46: ff 47: ff 8 | -------------------------------------------------------------------------------- 9 | -------------------------------------------------------------------------------- /sntp/tests/data/key-test-ascii: -------------------------------------------------------------------------------- 1 | 50 MD5 asciikeyOne 2 | 40 MD5 asciikeyTwo 3 | -------------------------------------------------------------------------------- /sntp/tests/data/key-test-comments: -------------------------------------------------------------------------------- 1 | # This is an initial comment, this file should contain 2 keys. 2 | 34 MD5 xyz #This is a comment after an ASCII key. 3 | 10 MD5 010101010101010101010101010101 #Comment after hex key. 4 | -------------------------------------------------------------------------------- /sntp/tests/data/key-test-empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/sntp/tests/data/key-test-empty -------------------------------------------------------------------------------- /sntp/tests/data/key-test-hex: -------------------------------------------------------------------------------- 1 | 10 MD5 0123456789abcdef0123456789 2 | 20 MD5 111111111111111111111111111111 3 | 30 MD5 01010101010101010101010101 4 | -------------------------------------------------------------------------------- /sntp/tests/data/key-test-invalid-hex: -------------------------------------------------------------------------------- 1 | 30 MD5 0101010101010101010101010101gh 2 | 10 MD5 010101010101010101010101010101 3 | -------------------------------------------------------------------------------- /sntp/tests/data/kod-expected-multiple: -------------------------------------------------------------------------------- 1 | 000000000000abcd DENY 192.0.2.1 2 | 000000000000abcd RSTR 192.0.2.5 3 | 000000000000abcd RATE example.com 4 | -------------------------------------------------------------------------------- /sntp/tests/data/kod-expected-single: -------------------------------------------------------------------------------- 1 | 0000000000000001 DENY host1 2 | -------------------------------------------------------------------------------- /sntp/tests/data/kod-output-blank: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/sntp/tests/data/kod-output-blank -------------------------------------------------------------------------------- /sntp/tests/data/kod-output-multiple: -------------------------------------------------------------------------------- 1 | 000000000000abcd DENY 192.0.2.1 2 | 000000000000abcd RSTR 192.0.2.5 3 | 000000000000abcd RATE example.com 4 | -------------------------------------------------------------------------------- /sntp/tests/data/kod-output-single: -------------------------------------------------------------------------------- 1 | 0000000000000001 DENY host1 2 | -------------------------------------------------------------------------------- /sntp/tests/data/kod-test-blanks: -------------------------------------------------------------------------------- 1 | 2 | 0000000012345678 DENY 192.0.2.5 3 | 4 | 0000000000000fff RSTR 192.0.2.100 5 | 000000000000abcd DENY example.com 6 | 7 | -------------------------------------------------------------------------------- /sntp/tests/data/kod-test-correct: -------------------------------------------------------------------------------- 1 | 0000000012345678 DENY 192.0.2.5 2 | 0000000000000fff RSTR 192.0.2.100 3 | -------------------------------------------------------------------------------- /sntp/tests/data/kod-test-empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ntp-project/ntp-missing-author-attribution/1a399a03e674da08cfce2cdb847bfb65d65df237/sntp/tests/data/kod-test-empty -------------------------------------------------------------------------------- /sntp/tests/fileHandlingTest.h.in: -------------------------------------------------------------------------------- 1 | #ifndef FILE_HANDLING_TEST_H 2 | #define FILE_HANDLING_TEST_H 3 | 4 | #include "config.h" 5 | #include "stdlib.h" 6 | #include "sntptest.h" 7 | 8 | #include 9 | #include 10 | 11 | 12 | enum DirectoryType { 13 | INPUT_DIR = 0, 14 | OUTPUT_DIR = 1 15 | }; 16 | 17 | #define SRCDIR_DEF "@abs_srcdir@/data/"; 18 | 19 | extern const char * CreatePath(const char* filename, 20 | enum DirectoryType argument); 21 | extern void DestroyPath(const char* pathname); 22 | extern int GetFileSize(FILE *file); 23 | extern bool CompareFileContent(FILE* expected, FILE* actual); 24 | extern void ClearFile(const char * filename) ; 25 | 26 | #endif // FILE_HANDLING_TEST_H 27 | -------------------------------------------------------------------------------- /sntp/tests/networking.c: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | #include "sntptest.h" 4 | 5 | #include "networking.h" 6 | 7 | #include "unity.h" 8 | -------------------------------------------------------------------------------- /sntp/tests/sntptest.c: -------------------------------------------------------------------------------- 1 | 2 | #include "config.h" 3 | #include "ntp_stdlib.h" 4 | #include "sntp-opts.h" 5 | #include "sntptest.h" 6 | 7 | void 8 | sntptest(void) { 9 | optionSaveState(&sntpOptions); 10 | } 11 | 12 | 13 | void 14 | sntptest_destroy(void) { 15 | optionRestore(&sntpOptions); 16 | } 17 | 18 | 19 | void 20 | ActivateOption(const char* option, const char* argument) { 21 | 22 | const int ARGV_SIZE = 4; 23 | 24 | char* opts[ARGV_SIZE]; 25 | 26 | opts[0] = estrdup("sntpopts"); 27 | opts[1] = estrdup(option); 28 | opts[2] = estrdup(argument); 29 | opts[3] = estrdup("127.0.0.1"); 30 | 31 | optionProcess(&sntpOptions, ARGV_SIZE, opts); 32 | } 33 | 34 | -------------------------------------------------------------------------------- /sntp/tests/sntptest.h: -------------------------------------------------------------------------------- 1 | #ifndef SNTPTEST_H 2 | #define SNTPTEST_H 3 | 4 | #include "ntp_stdlib.h" 5 | #include "sntp-opts.h" 6 | 7 | void sntptest(void); 8 | void sntptest_destroy(void); 9 | void ActivateOption(const char* option, const char* argument); 10 | 11 | #endif // SNTPTEST_H 12 | -------------------------------------------------------------------------------- /sntp/tests/tests-runner: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # $builddir is always . 4 | builddir=. 5 | # $srcdir will be set to the correct directory when this script is called from 6 | # the Makefiles generated by Automake. 7 | 8 | # Create output directory. 9 | mkdir -p $builddir/data 10 | 11 | # Test executable expects two arguments: test_input_dir and test_output_dir. 12 | ./tests $srcdir/data $builddir/data 13 | 14 | -------------------------------------------------------------------------------- /sntp/unity/Makefile.am: -------------------------------------------------------------------------------- 1 | #AUTOMAKE_OPTIONS = foreign 1.9 subdir-objects 2 | NULL = 3 | BUILT_SOURCES = 4 | CLEANFILES = 5 | 6 | noinst_LIBRARIES = libunity.a 7 | 8 | libunity_a_CFLAGS = \ 9 | -DUNITY_INCLUDE_CONFIG_H \ 10 | $(NULL) 11 | 12 | libunity_a_SOURCES = \ 13 | ../libpkgver/colcomp.c \ 14 | unity.c \ 15 | unity.h \ 16 | unity_config.h \ 17 | unity_internals.h \ 18 | unity_fixture.c \ 19 | unity_fixture.h \ 20 | unity_fixture_internals.h \ 21 | unity_fixture_malloc_overrides.h \ 22 | unity_config.h \ 23 | $(NULL) 24 | 25 | include $(top_srcdir)/depsver.mf 26 | include $(top_srcdir)/includes.mf 27 | -------------------------------------------------------------------------------- /sntp/unity/auto/test_file_filter.rb: -------------------------------------------------------------------------------- 1 | # ========================================== 2 | # Unity Project - A Test Framework for C 3 | # Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams 4 | # [Released under MIT License. Please refer to license.txt for details] 5 | # ========================================== 6 | 7 | require'yaml' 8 | 9 | module RakefileHelpers 10 | class TestFileFilter 11 | def initialize(all_files = false) 12 | @all_files = all_files 13 | if not @all_files == true 14 | if File.exist?('test_file_filter.yml') 15 | filters = YAML.load_file( 'test_file_filter.yml' ) 16 | @all_files, @only_files, @exclude_files = 17 | filters[:all_files], filters[:only_files], filters[:exclude_files] 18 | end 19 | end 20 | end 21 | attr_accessor :all_files, :only_files, :exclude_files 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /sntp/unity/auto/type_sanitizer.rb: -------------------------------------------------------------------------------- 1 | module TypeSanitizer 2 | 3 | def self.sanitize_c_identifier(unsanitized) 4 | # convert filename to valid C identifier by replacing invalid chars with '_' 5 | return unsanitized.gsub(/[-\/\\\.\,\s]/, "_") 6 | end 7 | 8 | end 9 | -------------------------------------------------------------------------------- /sntp/unity/unity_config.h: -------------------------------------------------------------------------------- 1 | /* unity_config.h */ 2 | 3 | #ifndef UNITY_CONFIG_H 4 | #define UNITY_CONFIG_H 5 | 6 | #define UNITY_INCLUDE_DOUBLE 7 | 8 | #ifndef HAVE_STDINT_H 9 | # define UNITY_EXCLUDE_STDINT_H 10 | #endif 11 | 12 | #endif /* UNITY_CONFIG_H */ 13 | -------------------------------------------------------------------------------- /sntp/unity/unity_fixture_malloc_overrides.h: -------------------------------------------------------------------------------- 1 | //- Copyright (c) 2010 James Grenning and Contributed to Unity Project 2 | /* ========================================== 3 | Unity Project - A Test Framework for C 4 | Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams 5 | [Released under MIT License. Please refer to license.txt for details] 6 | ========================================== */ 7 | 8 | #ifndef UNITY_FIXTURE_MALLOC_OVERRIDES_H_ 9 | #define UNITY_FIXTURE_MALLOC_OVERRIDES_H_ 10 | 11 | #define malloc unity_malloc 12 | #define calloc unity_calloc 13 | #define realloc unity_realloc 14 | #define free unity_free 15 | 16 | void* unity_malloc(size_t size); 17 | void* unity_calloc(size_t num, size_t size); 18 | void* unity_realloc(void * oldMem, size_t size); 19 | void unity_free(void * mem); 20 | 21 | #endif /* UNITY_FIXTURE_MALLOC_OVERRIDES_H_ */ 22 | -------------------------------------------------------------------------------- /sntp/utilities.h: -------------------------------------------------------------------------------- 1 | #ifndef UTILITIES_H 2 | #define UTILITIES_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "ntp.h" 9 | #include "ntp_stdlib.h" 10 | #include "lib_strbuf.h" 11 | 12 | #define HLINE "--------------------------------------------------------------------------------\n" 13 | #define PHLINE fprintf(output, HLINE); 14 | #define STDLINE printf(HLINE); 15 | 16 | 17 | void pkt_output(struct pkt *dpkg, int pkt_length, FILE *output); 18 | void l_fp_output(l_fp *ts, FILE *output); 19 | void l_fp_output_bin(l_fp *ts, FILE *output); 20 | void l_fp_output_dec(l_fp *ts, FILE *output); 21 | 22 | char *addrinfo_to_str(const struct addrinfo *addr); 23 | char *ss_to_str(sockaddr_u *saddr); 24 | char *tv_to_str(const struct timeval *tv); 25 | const char * hostnameaddr(const char *, const sockaddr_u *); 26 | 27 | #endif /* UTILITIES_H */ 28 | -------------------------------------------------------------------------------- /tests/Makefile.am: -------------------------------------------------------------------------------- 1 | NULL = 2 | SUBDIRS = 3 | 4 | SUBDIRS += \ 5 | bug-2803 \ 6 | libntp \ 7 | ntpd \ 8 | ntpq \ 9 | sandbox \ 10 | sec-2853 \ 11 | $(NULL) 12 | 13 | -------------------------------------------------------------------------------- /tests/libntp/atouint.c: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | #include "ntp_stdlib.h" 4 | #include "ntp_calendar.h" 5 | #include "ntp_fp.h" 6 | 7 | #include "unity.h" 8 | 9 | void test_RegularPositive(void); 10 | void test_PositiveOverflowBoundary(void); 11 | void test_PositiveOverflowBig(void); 12 | void test_Negative(void); 13 | void test_IllegalChar(void); 14 | 15 | 16 | 17 | void test_RegularPositive(void) { 18 | const char *str = "305"; 19 | u_long actual; 20 | 21 | TEST_ASSERT_TRUE(atouint(str, &actual)); 22 | TEST_ASSERT_EQUAL(305, actual); 23 | } 24 | 25 | void test_PositiveOverflowBoundary(void) { 26 | const char *str = "4294967296"; 27 | u_long actual; 28 | 29 | TEST_ASSERT_FALSE(atouint(str, &actual)); 30 | } 31 | 32 | void test_PositiveOverflowBig(void) { 33 | const char *str = "8000000000"; 34 | u_long actual; 35 | 36 | TEST_ASSERT_FALSE(atouint(str, &actual)); 37 | } 38 | 39 | void test_Negative(void) { 40 | const char *str = "-1"; 41 | u_long actual; 42 | 43 | TEST_ASSERT_FALSE(atouint(str, &actual)); 44 | } 45 | 46 | void test_IllegalChar(void) { 47 | const char *str = "50c3"; 48 | u_long actual; 49 | 50 | TEST_ASSERT_FALSE(atouint(str, &actual)); 51 | } 52 | -------------------------------------------------------------------------------- /tests/libntp/humandate.c: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | #include "ntp_calendar.h" 4 | #include "ntp_stdlib.h" 5 | 6 | #include "unity.h" 7 | 8 | void setUp(void); 9 | void test_RegularTime(void); 10 | void test_CurrentTime(void); 11 | 12 | 13 | void 14 | setUp(void) 15 | { 16 | init_lib(); 17 | 18 | return; 19 | } 20 | 21 | 22 | void 23 | test_RegularTime(void) 24 | { 25 | time_t sample = 1276601278; 26 | char expected[15]; 27 | struct tm* tm; 28 | 29 | tm = localtime(&sample); 30 | TEST_ASSERT_TRUE(tm != NULL); 31 | 32 | snprintf(expected, 15, "%02d:%02d:%02d", tm->tm_hour, tm->tm_min, tm->tm_sec); 33 | 34 | TEST_ASSERT_EQUAL_STRING(expected, humantime(sample)); 35 | 36 | return; 37 | } 38 | 39 | void 40 | test_CurrentTime(void) 41 | { 42 | time_t sample; 43 | char expected[15]; 44 | struct tm* tm; 45 | 46 | time(&sample); 47 | 48 | tm = localtime(&sample); 49 | TEST_ASSERT_TRUE(tm != NULL); 50 | 51 | snprintf(expected, 15, "%02d:%02d:%02d", tm->tm_hour, tm->tm_min, tm->tm_sec); 52 | 53 | TEST_ASSERT_EQUAL_STRING(expected, humantime(sample)); 54 | 55 | return; 56 | } 57 | -------------------------------------------------------------------------------- /tests/libntp/lfptest.c: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | #include "ntp_fp.h" 3 | #include "lfptest.h" 4 | 5 | int IsEqual(const l_fp expected, const l_fp actual) { 6 | if (L_ISEQU(&expected, &actual)) { 7 | return TRUE; 8 | } else { 9 | return FALSE; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/libntp/lfptest.h: -------------------------------------------------------------------------------- 1 | #ifndef NTP_TESTS_LFPTEST_H 2 | #define NTP_TESTS_LFPTEST_H 3 | 4 | #include "config.h" 5 | #include "ntp_fp.h" 6 | 7 | 8 | static const int32 HALF = -2147483647L - 1L; 9 | static const int32 HALF_PROMILLE_UP = 2147484; // slightly more than 0.0005 10 | static const int32 HALF_PROMILLE_DOWN = 2147483; // slightly less than 0.0005 11 | static const int32 QUARTER = 1073741824L; 12 | static const int32 QUARTER_PROMILLE_APPRX = 1073742L; 13 | 14 | int IsEqual(const l_fp expected, const l_fp actual); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /tests/libntp/modetoa.c: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | #include "ntp_stdlib.h" 4 | 5 | #include "unity.h" 6 | 7 | void setUp(void); 8 | void test_KnownMode(void); 9 | void test_UnknownMode(void); 10 | 11 | 12 | void 13 | setUp(void) 14 | { 15 | init_lib(); 16 | 17 | return; 18 | } 19 | 20 | 21 | void 22 | test_KnownMode(void) { 23 | const int MODE = 3; // Should be "client" 24 | 25 | TEST_ASSERT_EQUAL_STRING("client", modetoa(MODE)); 26 | } 27 | 28 | void 29 | test_UnknownMode(void) { 30 | const int MODE = 100; 31 | 32 | TEST_ASSERT_EQUAL_STRING("mode#100", modetoa(MODE)); 33 | } 34 | -------------------------------------------------------------------------------- /tests/libntp/numtoa.c: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | #include "ntp_stdlib.h" 4 | #include "ntp_fp.h" 5 | 6 | #include "unity.h" 7 | 8 | void setUp(void); 9 | void test_Address(void); 10 | void test_Netmask(void); 11 | 12 | 13 | void 14 | setUp(void) 15 | { 16 | init_lib(); 17 | 18 | return; 19 | } 20 | 21 | 22 | void 23 | test_Address(void) { 24 | const u_int32 input = htonl(3221225472UL + 512UL + 1UL); // 192.0.2.1 25 | 26 | TEST_ASSERT_EQUAL_STRING("192.0.2.1", numtoa(input)); 27 | } 28 | 29 | void 30 | test_Netmask(void) { 31 | // 255.255.255.0 32 | const u_int32 hostOrder = 255UL*256UL*256UL*256UL + 255UL*256UL*256UL + 255UL*256UL; 33 | const u_int32 input = htonl(hostOrder); 34 | 35 | TEST_ASSERT_EQUAL_STRING("255.255.255.0", numtoa(input)); 36 | } 37 | -------------------------------------------------------------------------------- /tests/libntp/numtohost.c: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | #include "ntp_stdlib.h" 4 | #include "ntp_fp.h" 5 | 6 | #include "unity.h" 7 | 8 | void setUp(void); 9 | void test_LoopbackNetNonResolve(void); 10 | 11 | 12 | void 13 | setUp(void) 14 | { 15 | init_lib(); 16 | 17 | return; 18 | } 19 | 20 | 21 | void 22 | test_LoopbackNetNonResolve(void) { 23 | /* A loopback address in 127.0.0.0/8 is chosen, and 24 | * numtohost() should not try to resolve it unless 25 | * it is 127.0.0.1 26 | */ 27 | 28 | const u_int32 input = 127*256*256*256 + 1*256 + 1; // 127.0.1.1 29 | 30 | TEST_ASSERT_EQUAL_STRING("127.0.1.1", numtohost(htonl(input))); 31 | } 32 | -------------------------------------------------------------------------------- /tests/libntp/prettydate.c: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | #include "ntp_stdlib.h" 4 | #include "ntp_calendar.h" 5 | #include "ntp_fp.h" 6 | 7 | #include "unity.h" 8 | 9 | void setUp(void); 10 | void test_ConstantDate(void); 11 | 12 | 13 | void 14 | setUp(void) 15 | { 16 | init_lib(); 17 | 18 | return; 19 | } 20 | 21 | 22 | void 23 | test_ConstantDate(void) { 24 | const u_int32 HALF = 2147483648UL; 25 | 26 | l_fp e_time = {{3485080800UL}, HALF}; /* 2010-06-09 14:00:00.5 */ 27 | 28 | TEST_ASSERT_EQUAL_STRING("cfba1ce0.80000000 Wed, Jun 9 2010 14:00:00.500", 29 | gmprettydate(&e_time)); 30 | return; 31 | } 32 | -------------------------------------------------------------------------------- /tests/libntp/sockaddrtest.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTS_SOCKADDRTEST_H 2 | #define TESTS_SOCKADDRTEST_H 3 | 4 | #include "config.h" 5 | #include "ntp.h" 6 | #include "ntp_stdlib.h" 7 | 8 | 9 | sockaddr_u CreateSockaddr4(const char* address, unsigned int port); 10 | 11 | int IsEqual(const sockaddr_u expected, const sockaddr_u actual); 12 | 13 | #endif // TESTS_SOCKADDRTEST_H 14 | -------------------------------------------------------------------------------- /tests/libntp/statestr.c: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | #include "ntp_stdlib.h" 4 | #include "ntp.h" // needed for MAX_MAC_LEN used in ntp_control.h 5 | #include "ntp_control.h" 6 | 7 | #include "unity.h" 8 | 9 | void setUp(void); 10 | void test_PeerRestart(void); 11 | void test_SysUnspecified(void); 12 | void test_ClockCodeExists(void); 13 | void test_ClockCodeUnknown(void); 14 | 15 | 16 | void 17 | setUp(void) 18 | { 19 | init_lib(); 20 | 21 | return; 22 | } 23 | 24 | 25 | // eventstr() 26 | void 27 | test_PeerRestart(void) { 28 | TEST_ASSERT_EQUAL_STRING("restart", eventstr(PEVNT_RESTART)); 29 | } 30 | 31 | 32 | void 33 | test_SysUnspecified(void) { 34 | TEST_ASSERT_EQUAL_STRING("unspecified", eventstr(EVNT_UNSPEC)); 35 | } 36 | 37 | 38 | // ceventstr() 39 | void 40 | test_ClockCodeExists(void) { 41 | TEST_ASSERT_EQUAL_STRING("clk_unspec", ceventstr(CTL_CLK_OKAY)); 42 | } 43 | 44 | 45 | void 46 | test_ClockCodeUnknown(void) { 47 | TEST_ASSERT_EQUAL_STRING("clk_-1", ceventstr(-1)); 48 | } 49 | -------------------------------------------------------------------------------- /tests/libntp/test-libntp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "ntp_stdlib.h" 4 | #include "ntp_calendar.h" 5 | 6 | #include "test-libntp.h" 7 | 8 | 9 | time_t nowtime = 0; 10 | 11 | 12 | time_t 13 | timefunc(time_t *ptr) { 14 | if (ptr) 15 | *ptr = nowtime; 16 | return nowtime; 17 | } 18 | 19 | 20 | void 21 | settime(int y, int m, int d, int H, int M, int S) { 22 | 23 | time_t days = ntpcal_edate_to_eradays(y-1, m-1, d-1) + 1 - DAY_UNIX_STARTS; 24 | time_t secs = ntpcal_etime_to_seconds(H, M, S); 25 | 26 | nowtime = days * SECSPERDAY + secs; 27 | } 28 | -------------------------------------------------------------------------------- /tests/libntp/test-libntp.h: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | #include "ntp_stdlib.h" 4 | #include "ntp_calendar.h" 5 | 6 | time_t timefunc(time_t *ptr); 7 | void settime(int y, int m, int d, int H, int M, int S); 8 | time_t nowtime; 9 | -------------------------------------------------------------------------------- /tests/libntp/uglydate.c: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | #include "ntp_stdlib.h" 4 | #include "ntp_fp.h" 5 | 6 | #include "unity.h" 7 | 8 | void setUp(void); 9 | void test_ConstantDateTime(void); 10 | 11 | 12 | void 13 | setUp(void) 14 | { 15 | init_lib(); 16 | 17 | return; 18 | } 19 | 20 | void 21 | test_ConstantDateTime(void) 22 | { 23 | const u_int32 HALF = 2147483648UL; 24 | 25 | l_fp e_time = {{3485080800UL}, HALF}; /* 2010-06-09 14:00:00.5 */ 26 | 27 | TEST_ASSERT_EQUAL_STRING("3485080800.500000 10:159:14:00:00.500", 28 | uglydate(&e_time)); 29 | return; 30 | } 31 | -------------------------------------------------------------------------------- /tests/libntp/ymd2yd.c: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | #include "ntp_stdlib.h" 4 | 5 | #include "unity.h" 6 | 7 | void test_NonLeapYearFebruary(void); 8 | void test_NonLeapYearJune(void); 9 | void test_LeapYearFebruary(void); 10 | void test_LeapYearDecember(void); 11 | 12 | 13 | void 14 | test_NonLeapYearFebruary(void) { 15 | TEST_ASSERT_EQUAL(31 + 20, ymd2yd(2010, 2, 20)); //2010-02-20 16 | } 17 | 18 | 19 | void 20 | test_NonLeapYearJune(void) { 21 | int expected = 31+28+31+30+31+18; // 18 June non-leap year 22 | TEST_ASSERT_EQUAL(expected, ymd2yd(2011, 6, 18)); 23 | } 24 | 25 | 26 | void 27 | test_LeapYearFebruary(void) { 28 | TEST_ASSERT_EQUAL(31 + 20, ymd2yd(2012, 2, 20)); //2012-02-20 (leap year) 29 | } 30 | 31 | 32 | void 33 | test_LeapYearDecember(void) { 34 | // 2012-12-31 35 | int expected = 31+29+31+30+31+30+31+31+30+31+30+31; 36 | TEST_ASSERT_EQUAL(expected, ymd2yd(2012, 12, 31)); 37 | } 38 | -------------------------------------------------------------------------------- /tests/ntpd/rc_cmdlength.c: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | #include "ntp.h" 4 | #include "ntp_calendar.h" 5 | #include "ntp_stdlib.h" 6 | #include "rc_cmdlength.h" 7 | 8 | #include "unity.h" 9 | 10 | #include 11 | 12 | #include "test-libntp.h" 13 | 14 | 15 | void 16 | test_EvaluateCommandLength(void){ 17 | size_t length, commandLength; 18 | const char *command1 = "Random Command"; 19 | const char *command2 = "Random Command\t\t\n\t"; 20 | const char *command3 = "Random\nCommand\t\t\n\t"; 21 | const char *command4 = "Random Command\t\t\n\t1 2 3"; 22 | 23 | length = strlen(command1); 24 | commandLength = remoteconfig_cmdlength(command1, command1+length); 25 | TEST_ASSERT_EQUAL(14, commandLength ); 26 | 27 | length = strlen(command2); 28 | commandLength = remoteconfig_cmdlength(command2, command2+length); 29 | TEST_ASSERT_EQUAL(14, commandLength ); 30 | 31 | length = strlen(command3); 32 | commandLength = remoteconfig_cmdlength(command3, command3+length); 33 | TEST_ASSERT_EQUAL(6, commandLength ); 34 | 35 | length = strlen(command4); 36 | commandLength = remoteconfig_cmdlength(command4, command4+length); 37 | TEST_ASSERT_EQUAL(16, commandLength ); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /tests/ntpq/t-ntpq.c: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | #include "ntp.h" 4 | //#include "ntp_stdlib.h" 5 | 6 | 7 | //#include "ntp_calendar.h" 8 | 9 | #include "unity.h" 10 | #include "ntpq.h" 11 | 12 | //very tricky to test static functions. It might be a good idea to use cmock here 13 | //#define HAVE_NTPQ 14 | //#include "ntpq.c" 15 | 16 | 17 | 18 | //extern int main(int argc, char *argv[]); 19 | 20 | void testPrimary(void); 21 | 22 | void testPrimary(void){ 23 | //main(NULL,NULL); 24 | /* 25 | char ** tokens; 26 | int * num = 0; 27 | tokenize("a bc de1 234",tokens, num); 28 | */ 29 | } 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | #define HAVE_NTP_SIGND 38 | -------------------------------------------------------------------------------- /tests/sandbox/bug-2803.h: -------------------------------------------------------------------------------- 1 | int main2( void ); 2 | -------------------------------------------------------------------------------- /tests/sandbox/modetoa.c: -------------------------------------------------------------------------------- 1 | //#include "config.h" 2 | //#include "libntptest.h" 3 | #include "unity.h" 4 | //#include "ntp_stdlib.h" 5 | 6 | 7 | 8 | void test_KnownMode(void) { 9 | const int MODE = 3; // Should be "client" 10 | TEST_ASSERT_EQUAL_STRING("client", modetoa(MODE)); 11 | 12 | // EXPECT_STREQ("client", modetoa(MODE)); 13 | } 14 | 15 | void test_UnknownMode(void) { 16 | const int MODE = 100; 17 | 18 | TEST_ASSERT_EQUAL_STRING("mode#1001", modetoa(MODE)); 19 | // EXPECT_STREQ("mode#100", modetoa(MODE)); 20 | } 21 | -------------------------------------------------------------------------------- /tests/sandbox/run-bug-2803.c: -------------------------------------------------------------------------------- 1 | /* AUTOGENERATED FILE. DO NOT EDIT. */ 2 | 3 | //=======Test Runner Used To Run Each Test Below===== 4 | #define RUN_TEST(TestFunc, TestLineNum) \ 5 | { \ 6 | Unity.CurrentTestName = #TestFunc; \ 7 | Unity.CurrentTestLineNumber = TestLineNum; \ 8 | Unity.NumberOfTests++; \ 9 | if (TEST_PROTECT()) \ 10 | { \ 11 | setUp(); \ 12 | TestFunc(); \ 13 | } \ 14 | if (TEST_PROTECT() && !TEST_IS_IGNORED) \ 15 | { \ 16 | tearDown(); \ 17 | } \ 18 | UnityConcludeTest(); \ 19 | } 20 | 21 | //=======Automagically Detected Files To Include===== 22 | #include "unity.h" 23 | #include 24 | #include 25 | 26 | //=======External Functions This Runner Calls===== 27 | extern void setUp(void); 28 | extern void tearDown(void); 29 | 30 | 31 | //=======Test Reset Option===== 32 | void resetTest() 33 | { 34 | tearDown(); 35 | setUp(); 36 | } 37 | 38 | 39 | //=======MAIN===== 40 | int main(void) 41 | { 42 | Unity.TestFile = "bug-2803.c"; 43 | UnityBegin(""); 44 | 45 | return (UnityEnd()); 46 | } 47 | -------------------------------------------------------------------------------- /tests/sandbox/uglydate.c: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | #include "ntp_fp.h" 3 | #include "unity.h" 4 | 5 | #include "ntp_stdlib.h" 6 | 7 | //#include "libntptest.h" 8 | 9 | void setUp(void); 10 | void test_ConstantDateTime(void); 11 | 12 | 13 | void 14 | setUp(void) 15 | { 16 | init_lib(); 17 | 18 | return; 19 | } 20 | 21 | 22 | void 23 | test_ConstantDateTime(void) 24 | { 25 | const u_int32 HALF = 2147483648UL; 26 | 27 | l_fp e_time = {{3485080800UL}, HALF}; // 2010-06-09 14:00:00.5 28 | 29 | TEST_ASSERT_EQUAL_STRING("3485080800.500000 10:159:14:00:00.500", 30 | uglydate(&e_time)); 31 | } 32 | -------------------------------------------------------------------------------- /util/byteorder.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This works on: 3 | * Crays 4 | * Conven 5 | * sparc's 6 | * Dec mip machines 7 | * Dec alpha machines 8 | * RS6000 9 | * SGI's 10 | */ 11 | 12 | #include 13 | 14 | int 15 | main( 16 | int argc, 17 | char *argv[] 18 | ) 19 | { 20 | int i; 21 | int big; 22 | union { 23 | unsigned long l; 24 | char c[sizeof(long)]; 25 | } u; 26 | 27 | #if defined(LONG8) 28 | u.l = (((long)0x08070605) << 32) | (long)0x04030201; 29 | #else 30 | u.l = 0x04030201; 31 | #endif 32 | if (sizeof(long) > 4) { 33 | if (u.c[0] == 0x08) big = 1; 34 | else big = 0; 35 | } else { 36 | if (u.c[0] == 0x04) big = 1; 37 | else big = 0; 38 | } 39 | for (i=0; i< sizeof(long); i++) { 40 | if (big == 1 && (u.c[i] == (sizeof(long) - i))) { 41 | continue; 42 | } else if (big == 0 && (u.c[i] == (i+1))) { 43 | continue; 44 | } else { 45 | big = -1; 46 | break; 47 | } 48 | } 49 | 50 | if (big == 1) { 51 | printf("XNTP_BIG_ENDIAN\n"); 52 | } else if (big == 0) { 53 | printf("XNTP_LITTLE_ENDIAN\n"); 54 | } 55 | exit(0); 56 | } 57 | -------------------------------------------------------------------------------- /util/invoke-ntp-keygen.menu: -------------------------------------------------------------------------------- 1 | * ntp-keygen Invocation:: Invoking ntp-keygen 2 | -------------------------------------------------------------------------------- /util/longsize.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | main() 4 | { 5 | if (sizeof(long) == 8) { 6 | printf("-DLONG8\n"); 7 | } else if (sizeof(long) == 4) { 8 | printf("-DLONG4\n"); 9 | } 10 | exit(0); 11 | } 12 | --------------------------------------------------------------------------------