$DragonFly: src/usr.sbin/ntpd/patches/Attic/ntpd.h.patch,v 1.7 2005/04/22 08:35:04 joerg Exp $ Index: ntpd.h =================================================================== RCS file: /home/joerg/wd/repository/dragonflybsd/src/contrib/ntpd/ntpd.h,v retrieving revision 1.6 diff -u -r1.6 ntpd.h --- ntpd.h 25 Feb 2005 16:43:19 -0000 1.6 +++ ntpd.h 28 Feb 2005 19:44:37 -0000 @@ -30,6 +30,8 @@ #include "ntp.h" +#define SA_LEN(_sa) ((_sa)->sa_len) + #define NTPD_USER "_ntp" #define CONFFILE "/etc/ntpd.conf" @@ -49,13 +51,16 @@ #define MAX_SERVERS_DNS 8 -#define QSCALE_OFF_MIN 0.05 -#define QSCALE_OFF_MAX 0.50 +#define QSCALE_OFF_MIN 0.005 +#define QSCALE_OFF_MAX 0.010 #define QUERYTIME_MAX 15 /* single query might take n secs max */ #define OFFSET_ARRAY_SIZE 8 #define SETTIME_MIN_OFFSET 180 /* min offset for settime at start */ -#define LOG_NEGLIGEE 128 /* negligible drift to not log (ms) */ +#define LOG_NEGLIGEE 32 /* negligible drift to not log (ms) */ + +#define FREQUENCY_SAMPLES 8 /* samples for est. of permanent drift */ +#define MAX_FREQUENCY_ADJUST 128e-6 /* max correction per iteration */ enum client_state { STATE_NONE, @@ -124,6 +129,9 @@ u_int8_t settime; u_int8_t debug; u_int32_t scale; + double overall_offset; + double freq_x, freq_y, freq_xx, freq_xy; + int freq_samples; }; struct buf { @@ -161,6 +169,7 @@ enum imsg_type { IMSG_NONE, IMSG_ADJTIME, + IMSG_ADJFREQ, IMSG_SETTIME, IMSG_HOST_DNS }; @@ -247,6 +256,8 @@ /* util.c */ double gettime(void); +double gettime_corrected(void); +double getoffset(void); void d_to_tv(double, struct timeval *); double lfp_to_d(struct l_fixedpt); struct l_fixedpt d_to_lfp(double);