diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-07-07 01:01:28 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-07-07 01:01:28 +0000 |
commit | b4ef1da0fa0b71751fb8a6071c0e05356ae40886 (patch) | |
tree | 992922ceeac13a0fbda8bb55aaaac54ea1ea92dd /usr.sbin/ntpd/ntpd.h | |
parent | ba7f0c4eefcc2a1f5b0b7a4ca7c181aa1c32e832 (diff) |
keep a "trustlevel" per peer. loose credit for loosing a packet, loose
a lot of credit for not having supplied us with enough data within an
adjtime run interval, and get a little credit each time we get a good
reply packet. if a peer is below 20%, only send a packet occasionally to
see wether it is back. send out queries much more often between 20 and 80%
to (re-)sync quickly, and above 80% usethe regular interval.
do not use peers < 60% for calculating teh local clock offset.
designed with theo at the pho, alexander ok
Diffstat (limited to 'usr.sbin/ntpd/ntpd.h')
-rw-r--r-- | usr.sbin/ntpd/ntpd.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/usr.sbin/ntpd/ntpd.h b/usr.sbin/ntpd/ntpd.h index 795fd55f432..48b6be875d1 100644 --- a/usr.sbin/ntpd/ntpd.h +++ b/usr.sbin/ntpd/ntpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ntpd.h,v 1.13 2004/07/06 23:26:38 henning Exp $ */ +/* $OpenBSD: ntpd.h,v 1.14 2004/07/07 01:01:27 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -36,9 +36,17 @@ #define NTPD_OPT_VERBOSE 0x0001 #define NTPD_OPT_VERBOSE2 0x0002 -#define INTERVAL_ADJTIME 240 /* call adjtime every n seconds */ -#define INTERVAL_QUERY 30 /* sync with peers every n seconds */ +#define INTERVAL_ADJTIME 240 /* call adjtime every n secs */ +#define INTERVAL_QUERY_NORMAL 30 /* sync to peers every n secs */ +#define INTERVAL_QUERY_PATHETIC 60 +#define INTERVAL_QUERY_AGRESSIVE 5 + +#define TRUSTLEVEL_BADPEER 6 +#define TRUSTLEVEL_PATHETIC 2 +#define TRUSTLEVEL_AGRESSIVE 8 + #define QUERYTIME_MAX 15 /* single query might take n secs max */ +#define REPLY_MAXAGE 300 #define OFFSET_ARRAY_SIZE 8 enum client_state { @@ -70,7 +78,7 @@ struct ntp_peer { time_t deadline; struct ntp_offset reply[OFFSET_ARRAY_SIZE]; u_int8_t shift; - u_int8_t valid; + u_int8_t trustlevel; }; struct ntpd_conf { |