003 File Manager
Current Path:
/usr/src/contrib/ntp/ntpd
usr
/
src
/
contrib
/
ntp
/
ntpd
/
📁
..
📄
Makefile.am
(13.57 KB)
📄
Makefile.in
(78.52 KB)
📄
check_y2k.c
(15.73 KB)
📄
cmd_args.c
(4.25 KB)
📄
complete.conf.in
(3.35 KB)
📄
declcond.h
(793 B)
📄
invoke-ntp.conf.menu
(56 B)
📄
invoke-ntp.conf.texi
(104.37 KB)
📄
invoke-ntp.keys.menu
(56 B)
📄
invoke-ntp.keys.texi
(3.21 KB)
📄
invoke-ntpd.menu
(49 B)
📄
invoke-ntpd.texi
(23.68 KB)
📄
jupiter.h
(9.1 KB)
📄
keyword-gen-utd
(57 B)
📄
keyword-gen.c
(21.99 KB)
📄
ntp.conf.5man
(115.01 KB)
📄
ntp.conf.5mdoc
(101.72 KB)
📄
ntp.conf.def
(100.75 KB)
📄
ntp.conf.html
(126.28 KB)
📄
ntp.conf.man.in
(115.01 KB)
📄
ntp.conf.mdoc.in
(101.71 KB)
📄
ntp.conf.texi
(1.19 KB)
📄
ntp.keys.5man
(3.99 KB)
📄
ntp.keys.5mdoc
(4.25 KB)
📄
ntp.keys.def
(3.65 KB)
📄
ntp.keys.html
(8.37 KB)
📄
ntp.keys.man.in
(3.99 KB)
📄
ntp.keys.mdoc.in
(4.24 KB)
📄
ntp.keys.texi
(1.2 KB)
📄
ntp_config.c
(117.55 KB)
📄
ntp_control.c
(123.14 KB)
📄
ntp_crypto.c
(117.09 KB)
📄
ntp_filegen.c
(13.42 KB)
📄
ntp_io.c
(112.21 KB)
📄
ntp_keyword.h
(73.49 KB)
📄
ntp_leapsec.c
(31.18 KB)
📄
ntp_leapsec.h
(10.95 KB)
📄
ntp_loopfilter.c
(40.05 KB)
📄
ntp_monitor.c
(13.43 KB)
📄
ntp_parser.c
(130.65 KB)
📄
ntp_parser.h
(11.36 KB)
📄
ntp_peer.c
(27.66 KB)
📄
ntp_prio_q.c
(4.54 KB)
📄
ntp_proto.c
(150.76 KB)
📄
ntp_refclock.c
(43.87 KB)
📄
ntp_request.c
(67.25 KB)
📄
ntp_restrict.c
(19.06 KB)
📄
ntp_scanner.c
(20.74 KB)
📄
ntp_scanner.h
(4.43 KB)
📄
ntp_signd.c
(5.24 KB)
📄
ntp_timer.c
(17.69 KB)
📄
ntp_util.c
(22.66 KB)
📄
ntpd-opts.c
(71.91 KB)
📄
ntpd-opts.def
(17.55 KB)
📄
ntpd-opts.h
(14.57 KB)
📄
ntpd.1ntpdman
(32.03 KB)
📄
ntpd.1ntpdmdoc
(29.07 KB)
📄
ntpd.c
(42.16 KB)
📄
ntpd.html
(49.68 KB)
📄
ntpd.man.in
(32.03 KB)
📄
ntpd.mdoc.in
(29.07 KB)
📄
ntpd.texi
(3.25 KB)
📄
ntpdbase-opts.def
(13.21 KB)
📄
ntpsim.c
(17.11 KB)
📄
ppsapi_timepps.h
(497 B)
📄
psl0.conf
(25 B)
📄
psl1.conf
(25 B)
📄
psl2.conf
(37 B)
📄
rc_cmdlength.c
(800 B)
📄
refclock_acts.c
(22.66 KB)
📄
refclock_arbiter.c
(12.15 KB)
📄
refclock_arc.c
(46.85 KB)
📄
refclock_as2201.c
(11.09 KB)
📄
refclock_atom.c
(6.63 KB)
📄
refclock_bancomm.c
(16.11 KB)
📄
refclock_chronolog.c
(7.61 KB)
📄
refclock_chu.c
(45.28 KB)
📄
refclock_conf.c
(7.25 KB)
📄
refclock_datum.c
(22.3 KB)
📄
refclock_dumbclock.c
(8.42 KB)
📄
refclock_fg.c
(6.89 KB)
📄
refclock_gpsdjson.c
(58 KB)
📄
refclock_gpsvme.c
(7.77 KB)
📄
refclock_heath.c
(12.97 KB)
📄
refclock_hopfpci.c
(5.69 KB)
📄
refclock_hopfser.c
(7.41 KB)
📄
refclock_hpgps.c
(16.38 KB)
📄
refclock_irig.c
(30.05 KB)
📄
refclock_jjy.c
(144.27 KB)
📄
refclock_jupiter.c
(25.66 KB)
📄
refclock_leitch.c
(13.27 KB)
📄
refclock_local.c
(5.72 KB)
📄
refclock_msfees.c
(44.66 KB)
📄
refclock_mx4200.c
(41.72 KB)
📄
refclock_neoclock4x.c
(29.08 KB)
📄
refclock_nmea.c
(50.6 KB)
📄
refclock_oncore.c
(121.54 KB)
📄
refclock_palisade.c
(35.15 KB)
📄
refclock_palisade.h
(6.52 KB)
📄
refclock_parse.c
(160.87 KB)
📄
refclock_pcf.c
(4.79 KB)
📄
refclock_pst.c
(8.09 KB)
📄
refclock_ripencc.c
(118.21 KB)
📄
refclock_shm.c
(16.96 KB)
📄
refclock_tpro.c
(4.69 KB)
📄
refclock_true.c
(25.3 KB)
📄
refclock_tsyncpci.c
(28.35 KB)
📄
refclock_tt560.c
(6.12 KB)
📄
refclock_ulink.c
(15.64 KB)
📄
refclock_wwv.c
(79.32 KB)
📄
refclock_wwvb.c
(15.71 KB)
📄
refclock_zyfer.c
(7.38 KB)
Editing: refclock_hopfpci.c
/* * refclock_hopfpci.c * * - clock driver for hopf 6039 PCI board (GPS or DCF77) * Bernd Altmeier altmeier@atlsoft.de * * latest source and further information can be found at: * http://www.ATLSoft.de/ntp * * In order to run this driver you have to install and test * the PCI-board driver for your system first. * * On Linux/UNIX * * The driver attempts to open the device /dev/hopf6039 . * The device entry will be made by the installation process of * the kernel module for the PCI-bus board. The driver sources * belongs to the delivery equipment of the PCI-board. * * On Windows NT/2000 * * The driver attempts to open the device by calling the function * "OpenHopfDevice()". This function will be installed by the * Device Driver for the PCI-bus board. The driver belongs to the * delivery equipment of the PCI-board. * * * Start 21.03.2000 Revision: 01.20 * changes 22.12.2000 Revision: 01.40 flag1 = 1 sync even if Quarz * */ #ifdef HAVE_CONFIG_H # include <config.h> #endif #if defined(REFCLOCK) && defined(CLOCK_HOPF_PCI) #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" #include "ntp_unixtime.h" #include "ntp_stdlib.h" #undef fileno #include <ctype.h> #undef fileno #ifndef SYS_WINNT # include <sys/ipc.h> # include <sys/ioctl.h> # include <assert.h> # include <unistd.h> # include <stdio.h> # include "hopf6039.h" #else # include "hopf_PCI_io.h" #endif /* * hopfpci interface definitions */ #define PRECISION (-10) /* precision assumed (1 ms) */ #define REFID "hopf" /* reference ID */ #define DESCRIPTION "hopf Elektronik PCI radio board" #define NSAMPLES 3 /* stages of median filter */ #ifndef SYS_WINNT # define DEVICE "/dev/hopf6039" /* device name inode*/ #else # define DEVICE "hopf6039" /* device name WinNT */ #endif #define LEWAPWAR 0x20 /* leap second warning bit */ #define HOPF_OPMODE 0xC0 /* operation mode mask */ #define HOPF_INVALID 0x00 /* no time code available */ #define HOPF_INTERNAL 0x40 /* internal clock */ #define HOPF_RADIO 0x80 /* radio clock */ #define HOPF_RADIOHP 0xC0 /* high precision radio clock */ /* * hopfclock unit control structure. */ struct hopfclock_unit { short unit; /* NTP refclock unit number */ char leap_status; /* leap second flag */ }; int fd; /* file descr. */ /* * Function prototypes */ static int hopfpci_start (int, struct peer *); static void hopfpci_shutdown (int, struct peer *); static void hopfpci_poll (int unit, struct peer *); /* * Transfer vector */ struct refclock refclock_hopfpci = { hopfpci_start, /* start up driver */ hopfpci_shutdown, /* shut down driver */ hopfpci_poll, /* transmit poll message */ noentry, /* not used */ noentry, /* initialize driver (not used) */ noentry, /* not used */ NOFLAGS /* not used */ }; /* * hopfpci_start - attach to hopf PCI board 6039 */ static int hopfpci_start( int unit, struct peer *peer ) { struct refclockproc *pp; struct hopfclock_unit *up; /* * Allocate and initialize unit structure */ up = emalloc_zero(sizeof(*up)); #ifndef SYS_WINNT fd = open(DEVICE,O_RDWR); /* try to open hopf clock device */ #else if (!OpenHopfDevice()) { msyslog(LOG_ERR, "Start: %s unit: %d failed!", DEVICE, unit); free(up); return (0); } #endif pp = peer->procptr; pp->io.clock_recv = noentry; pp->io.srcclock = peer; pp->io.datalen = 0; pp->io.fd = INVALID_SOCKET; pp->unitptr = up; get_systime(&pp->lastrec); /* * Initialize miscellaneous peer variables */ memcpy((char *)&pp->refid, REFID, 4); peer->precision = PRECISION; pp->clockdesc = DESCRIPTION; up->leap_status = 0; up->unit = (short) unit; return (1); } /* * hopfpci_shutdown - shut down the clock */ static void hopfpci_shutdown( int unit, struct peer *peer ) { #ifndef SYS_WINNT close(fd); #else CloseHopfDevice(); #endif if (NULL != peer->procptr->unitptr) free(peer->procptr->unitptr); } /* * hopfpci_poll - called by the transmit procedure */ static void hopfpci_poll( int unit, struct peer *peer ) { struct refclockproc *pp; HOPFTIME m_time; pp = peer->procptr; #ifndef SYS_WINNT if (ioctl(fd, HOPF_CLOCK_GET_UTC, &m_time) < 0) msyslog(LOG_ERR, "HOPF_P(%d): HOPF_CLOCK_GET_UTC: %m", unit); #else GetHopfSystemTime(&m_time); #endif pp->polls++; pp->day = ymd2yd(m_time.wYear,m_time.wMonth,m_time.wDay); pp->hour = m_time.wHour; pp->minute = m_time.wMinute; pp->second = m_time.wSecond; pp->nsec = m_time.wMilliseconds * 1000000; if (m_time.wStatus & LEWAPWAR) pp->leap = LEAP_ADDSECOND; else pp->leap = LEAP_NOWARNING; snprintf(pp->a_lastcode, sizeof(pp->a_lastcode), "ST: %02X T: %02d:%02d:%02d.%03ld D: %02d.%02d.%04d", m_time.wStatus, pp->hour, pp->minute, pp->second, pp->nsec / 1000000, m_time.wDay, m_time.wMonth, m_time.wYear); pp->lencode = (u_short)strlen(pp->a_lastcode); get_systime(&pp->lastrec); /* * If clock has no valid status then report error and exit */ if ((m_time.wStatus & HOPF_OPMODE) == HOPF_INVALID) { /* time ok? */ refclock_report(peer, CEVNT_BADTIME); pp->leap = LEAP_NOTINSYNC; return; } /* * Test if time is running on internal quarz * if CLK_FLAG1 is set, sychronize even if no radio operation */ if ((m_time.wStatus & HOPF_OPMODE) == HOPF_INTERNAL){ if ((pp->sloppyclockflag & CLK_FLAG1) == 0) { refclock_report(peer, CEVNT_BADTIME); pp->leap = LEAP_NOTINSYNC; return; } } if (!refclock_process(pp)) { refclock_report(peer, CEVNT_BADTIME); return; } pp->lastref = pp->lastrec; refclock_receive(peer); record_clock_stats(&peer->srcadr, pp->a_lastcode); return; } #else int refclock_hopfpci_bs; #endif /* REFCLOCK */
Upload File
Create Folder