Merge from vendor branch BIND:
[dragonfly.git] / usr.sbin / ntpd / patches / ntpd.h.patch
1 $DragonFly: src/usr.sbin/ntpd/patches/Attic/ntpd.h.patch,v 1.7 2005/04/22 08:35:04 joerg Exp $
2
3 Index: ntpd.h
4 ===================================================================
5 RCS file: /home/joerg/wd/repository/dragonflybsd/src/contrib/ntpd/ntpd.h,v
6 retrieving revision 1.6
7 diff -u -r1.6 ntpd.h
8 --- ntpd.h      25 Feb 2005 16:43:19 -0000      1.6
9 +++ ntpd.h      28 Feb 2005 19:44:37 -0000
10 @@ -30,6 +30,8 @@
11  
12  #include "ntp.h"
13  
14 +#define        SA_LEN(_sa)     ((_sa)->sa_len)
15 +
16  #define        NTPD_USER       "_ntp"
17  #define        CONFFILE        "/etc/ntpd.conf"
18  
19 @@ -49,13 +51,16 @@
20  
21  #define        MAX_SERVERS_DNS                 8
22  
23 -#define        QSCALE_OFF_MIN                  0.05
24 -#define        QSCALE_OFF_MAX                  0.50
25 +#define        QSCALE_OFF_MIN                  0.005
26 +#define        QSCALE_OFF_MAX                  0.010
27  
28  #define        QUERYTIME_MAX           15      /* single query might take n secs max */
29  #define        OFFSET_ARRAY_SIZE       8
30  #define        SETTIME_MIN_OFFSET      180     /* min offset for settime at start */
31 -#define        LOG_NEGLIGEE            128     /* negligible drift to not log (ms) */
32 +#define        LOG_NEGLIGEE            32      /* negligible drift to not log (ms) */
33 +
34 +#define        FREQUENCY_SAMPLES       8       /* samples for est. of permanent drift */
35 +#define        MAX_FREQUENCY_ADJUST    128e-6  /* max correction per iteration */
36  
37  enum client_state {
38         STATE_NONE,
39 @@ -124,6 +129,9 @@
40         u_int8_t                                settime;
41         u_int8_t                                debug;
42         u_int32_t                               scale;
43 +       double                                  overall_offset;
44 +       double                                  freq_x, freq_y, freq_xx, freq_xy;
45 +       int                                     freq_samples;
46  };
47  
48  struct buf {
49 @@ -161,6 +169,7 @@
50  enum imsg_type {
51         IMSG_NONE,
52         IMSG_ADJTIME,
53 +       IMSG_ADJFREQ,
54         IMSG_SETTIME,
55         IMSG_HOST_DNS
56  };
57 @@ -247,6 +256,8 @@
58  
59  /* util.c */
60  double                 gettime(void);
61 +double                 gettime_corrected(void);
62 +double                 getoffset(void);
63  void                   d_to_tv(double, struct timeval *);
64  double                 lfp_to_d(struct l_fixedpt);
65  struct l_fixedpt       d_to_lfp(double);