📄 35
字号:
#include "ntp_stdlib.h" char * utvtoa(tv)! struct timeval *tv; { register char *buf; --- 11,21 ---- #include "ntp_fp.h" #endif #include "ntp_stdlib.h"+ #include "ntp_unixtime.h" char * utvtoa(tv)! const struct timeval *tv; { register char *buf; ------ From ntpq:RCS file: RCS/ntpq.c,vretrieving revision 1.1diff -c -r1.1 ntpq.c*** /tmp/,RCSt1a09747 Thu Nov 7 23:31:49 1996--- ntpq.c Thu Nov 7 23:31:39 1996****************** 216,221 ****--- 216,222 ---- static int sendpkt P((char *, int)); static int getresponse P((int, int, u_short *, int *, char **, int)); static int sendrequest P((int, int, int, int, char *));+ static char * tstflags P((u_long)); static void getcmds P((void)); static RETSIGTYPE abortcmd P((int)); static void docmd P((char *));------ From libparse:RCS file: RCS/parse.c,vretrieving revision 1.1diff -c -r1.1 parse.c*** /tmp/,RCSt1a09804 Thu Nov 7 23:37:50 1996--- parse.c Thu Nov 7 23:37:46 1996****************** 24,29 ****--- 24,30 ---- #include <config.h> #endif + #ifdef NeXT /* * This is lame, but gets us a symbol for the libparse library so the NeXTstep * ranlib doesn't stop the compile.****************** 31,36 ****--- 32,38 ---- void token_libparse_symbol() { }+ #endif #if defined(REFCLOCK) && (defined(PARSE) || defined(PARSEPPS)) ------ From xntpd:RCS file: RCS/ntp_config.c,vretrieving revision 1.1diff -c -r1.1 ntp_config.c*** /tmp/,RCSt1a09918 Thu Nov 7 23:41:34 1996--- ntp_config.c Thu Nov 7 23:38:30 1996****************** 358,364 **** #ifdef DEBUG extern int debug; #endif- extern char *FindConfig(); char *progname; char sys_phone[MAXPHONE][MAXDIAL]; /* ACTS phone numbers */ static char *xntp_options = "abc:dD:f:gk:l:mp:r:s:t:v:V:x";--- 358,363 ----===================================================================RCS file: RCS/ntp_io.c,vretrieving revision 1.1diff -c -r1.1 ntp_io.c*** /tmp/,RCSt1a09918 Thu Nov 7 23:41:34 1996--- ntp_io.c Thu Nov 7 23:38:37 1996****************** 20,27 ****--- 20,29 ---- # include <netinet/in.h> #endif #ifdef HAVE_SYS_IOCTL_H /* Was most BSDs and AIX - looking for what? */+ #ifdef HAVE_BSD_TTYS # include <sys/ioctl.h> #endif+ #endif #ifdef HAVE_SYS_SOCKIO_H /* Was SYS_UXPV: SIOC* #defines (Frank Vance <fvance@waii.com>) */ # include <sys/sockio.h> #endif****************** 172,185 **** static int create_sockets P((u_int)); static int open_socket P((struct sockaddr_in *, int, int)); static void close_socket P((int)); #ifdef HAVE_SIGNALED_IO! static int init_clock_sig P(()); static void init_socket_sig P((int));- static void set_signal P(()); static RETSIGTYPE sigio_handler P((int)); static void block_sigio P((void));! static void unblock_sigio P(()); #endif #ifndef STREAMS_TLI # ifndef SYS_WINNT extern char *inet_ntoa P((struct in_addr));--- 174,188 ---- static int create_sockets P((u_int)); static int open_socket P((struct sockaddr_in *, int, int)); static void close_socket P((int));+ static char * fdbits P((int, fd_set *)); #ifdef HAVE_SIGNALED_IO! static int init_clock_sig P((struct refclockio *)); static void init_socket_sig P((int)); static RETSIGTYPE sigio_handler P((int)); static void block_sigio P((void));! static void unblock_sigio P((void)); #endif+ static void set_signal P((void)); #ifndef STREAMS_TLI # ifndef SYS_WINNT extern char *inet_ntoa P((struct in_addr));===================================================================RCS file: RCS/ntp_monitor.c,vretrieving revision 1.1diff -c -r1.1 ntp_monitor.c*** /tmp/,RCSt1a09918 Thu Nov 7 23:41:34 1996--- ntp_monitor.c Thu Nov 7 23:38:44 1996****************** 11,17 ****--- 11,19 ---- #include <errno.h> #ifndef SYS_WINNT #if !defined(VMS)+ #ifdef HAVE_BSD_TTYS #include <sys/ioctl.h>+ #endif #endif /* VMS */ #include <sys/time.h> #endif /* SYS_WINNT */===================================================================RCS file: RCS/ntp_proto.c,vretrieving revision 1.1diff -c -r1.1 ntp_proto.c*** /tmp/,RCSt1a09918 Thu Nov 7 23:41:35 1996--- ntp_proto.c Thu Nov 7 23:38:51 1996****************** 15,20 ****--- 15,21 ---- #include "ntp_stdlib.h" #include "ntp_unixtime.h" #include "ntp_control.h"+ #include "ntp_string.h" #if defined(VMS) && defined(VMS_LOCALUNIT) /*wjm*/ #include "ntp_refclock.h"===================================================================RCS file: RCS/ntp_request.c,vretrieving revision 1.1diff -c -r1.1 ntp_request.c*** /tmp/,RCSt1a09918 Thu Nov 7 23:41:35 1996--- ntp_request.c Thu Nov 7 23:40:33 1996****************** 48,54 **** short request_code; /* defined request code */ short needs_auth; /* true when authentication needed */ short sizeofitem; /* size of request data item */! void (*handler)(); /* routine to handle request */ }; /*--- 48,55 ---- short request_code; /* defined request code */ short needs_auth; /* true when authentication needed */ short sizeofitem; /* size of request data item */! void (*handler) P((struct sockaddr_in *, struct interface *,! struct req_pkt *)); /* routine to handle request */ }; /******************* 1603,1609 **** */ struct reset_entry { int flag; /* flag this corresponds to */! void (*handler)(); /* routine to handle request */ }; struct reset_entry reset_entries[] = {--- 1604,1610 ---- */ struct reset_entry { int flag; /* flag this corresponds to */! void (*handler) P((void)); /* routine to handle request */ }; struct reset_entry reset_entries[] = {===================================================================RCS file: RCS/ntp_unixclock.c,vretrieving revision 1.1diff -c -r1.1 ntp_unixclock.c*** /tmp/,RCSt1a09918 Thu Nov 7 23:41:35 1996--- ntp_unixclock.c Thu Nov 7 23:40:46 1996****************** 556,562 **** #ifdef DEBUG if (debug)! printf("tick = %d, tickadj = %d\n", *ptick, *ptickadj); #endif } #endif /* not VMS */--- 556,563 ---- #ifdef DEBUG if (debug)! printf("tick = %ld, tickadj = %ld\n",! (long)*ptick, (long)*ptickadj); #endif } #endif /* not VMS */===================================================================RCS file: RCS/ntp_util.c,vretrieving revision 1.1diff -c -r1.1 ntp_util.c*** /tmp/,RCSt1a09918 Thu Nov 7 23:41:36 1996--- ntp_util.c Thu Nov 7 23:39:09 1996****************** 11,17 ****--- 11,19 ---- #include <sys/types.h> #ifndef SYS_WINNT #if !defined(VMS)+ #ifdef HAVE_BSD_TTYS #include <sys/ioctl.h>+ #endif #endif /* VMS */ #include <sys/time.h> #endif /* SYS_WINNT */===================================================================RCS file: RCS/ntpd.c,vretrieving revision 1.1diff -c -r1.1 ntpd.c*** /tmp/,RCSt1a09918 Thu Nov 7 23:41:36 1996--- ntpd.c Thu Nov 7 23:39:03 1996****************** 17,23 **** # endif /* VMS */ # include <sys/signal.h> # ifdef HAVE_SYS_IOCTL_H! /*# include <sys/ioctl.h> /* This loses under SunOS4; who needs it? */ # endif /* HAVE_SYS_IOCTL_H */ # include <sys/time.h> # if !defined(VMS) /*wjm*/--- 17,25 ---- # endif /* VMS */ # include <sys/signal.h> # ifdef HAVE_SYS_IOCTL_H! # ifdef notdef! # include <sys/ioctl.h> /* This loses under SunOS4; who needs it? */! # endif # endif /* HAVE_SYS_IOCTL_H */ # include <sys/time.h> # if !defined(VMS) /*wjm*/===================================================================RCS file: RCS/refclock_mx4200.c,vretrieving revision 1.1diff -c -r1.1 refclock_mx4200.c*** /tmp/,RCSt1a09918 Thu Nov 7 23:41:36 1996--- refclock_mx4200.c Thu Nov 7 23:41:05 1996****************** 69,75 **** */ /*! * Definitions */ #define DEVICE "/dev/gps%d" /* device name and unit */ #define SPEED232 B4800 /* baud */--- 69,75 ---- */ /*! * GPS Definitions */ #define DEVICE "/dev/gps%d" /* device name and unit */ #define SPEED232 B4800 /* baud */****************** 83,89 **** * Radio interface parameters */ #define PRECISION (-18) /* precision assumed (about 4 us) */! #define REFID "GPS" /* reference id */ #define DESCRIPTION "Magnavox MX4200 GPS Receiver" /* who we are */ #define DEFFUDGETIME 0 /* default fudge time (ms) */ --- 83,89 ---- * Radio interface parameters */ #define PRECISION (-18) /* precision assumed (about 4 us) */! #define REFID "GPS\0" /* reference id */ #define DESCRIPTION "Magnavox MX4200 GPS Receiver" /* who we are */ #define DEFFUDGETIME 0 /* default fudge time (ms) */ ****************** 93,112 **** static int leap_debug; /*! * Imported from the timer module */! extern u_long current_time;! extern struct event timerqueue[]; /*! * Imported from ntp_loopfilter module */! extern int fdpps; /* pps file descriptor */ /*! * Imported from ntpd module */! extern int debug; /* global debug flag */ /* * MX4200 unit control structure.--- 93,113 ---- static int leap_debug; /*! * Imported from ntp_timer module */! extern u_long current_time; /* current time (s) */ /*! * Imported from ntpd module */! extern int debug; /* global debug flag */ + #ifdef PPS /*! * Imported from loop_filter module */! extern int fdpps; /* ppsclock file descriptor */! #endif /* PPS */ /* * MX4200 unit control structure.****************** 115,121 **** u_long gpssamples[NSTAMPS]; /* the GPS time samples */ l_fp unixsamples[NSTAMPS]; /* the UNIX time samples */ - l_fp lastsampletime; /* time of last estimate */ u_int lastserial; /* last pps serial number */ u_long lasttime; /* last time clock heard from */--- 116,121 ----****************** 147,153 **** static int mx4200_needconf P((char *)); static void mx4200_config P((struct peer *)); static void mx4200_send P((int, char *, ...));! static int mx4200_cmpl_fp P((void *, void *)); static u_char cksum P((char *, u_int)); /*--- 147,153 ---- static int mx4200_needconf P((char *)); static void mx4200_config P((struct peer *)); static void mx4200_send P((int, char *, ...));! int mx4200_cmpl_fp P((void *, void *)); static u_char cksum P((char *, u_int)); /******************* 187,194 **** /* * Allocate unit structure */! if (!(up = (struct mx4200unit *)! emalloc(sizeof(struct mx4200unit)))) { (void) close(fd); return (0); }--- 187,193 ---- /* * Allocate unit structure */! if (!(up = (struct mx4200unit *)emalloc(sizeof(struct mx4200unit)))) { (void) close(fd); return (0); }****************** 252,258 ****--- 251,262 ---- PMVXG_S_PORTCONF, 1); mx4200_send(pp->io.fd, "%s,%03d,,%d,,,,,,", pmvxg, PMVXG_S_PORTCONF, 1);+ /*+ * Request software configuration so we can syslog the firmware version+ */+ mx4200_send(pp->io.fd, "%s,%03d", "CDGPQ", PMVXG_D_SOFTCONF); + /* * Switch to 2d mode */****************** 334,339 ****--- 338,346 ---- int valid, leapsec; register u_char ck; + /*+ * Initialize pointers and read the timecode and timestamp.+ */ peer = (struct peer *)rbufp->recv_srcclock; pp = peer->procptr; up = (struct mx4200unit *)pp->unitptr;****************** 539,545 **** } /* Compare two l_fp's, used with qsort() */! static int mx4200_cmpl_fp(p1, p2) register void *p1, *p2; {--- 546,552 ---- } /* Compare two l_fp's, used with qsort() */! int mx4200_cmpl_fp(p1, p2) register void *p1, *p2; {****************** 669,676 **** /* Record type */ v = strtol(cp, &cp, 10);! if (v != PMVXG_D_STATUS) return (0); /* * XXX * Since we configure the receiver to not give us status--- 676,687 ---- /* Record type */ v = strtol(cp, &cp, 10);! if (v != PMVXG_D_STATUS) {! if (v == PMVXG_D_SOFTCONF)! syslog(LOG_DEBUG,! "mx4200_needconf: software config: %s", buf); return (0);+ } /* * XXX * Since we configure the receiver to not give us status****************** 680,686 **** * indicates the reciever needs to be initialized; thus, it is * not necessary to decode the status message. */! return (1); } /* Parse a mx4200 time recovery message. Returns a string if error */--- 691,697 ---- * indicates the reciever needs to be initialized; thus, it is * not necessary to decode the status message. */! return (1); } /* Parse a mx4200 time recovery message. Returns a string if error */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -