From 43d3d7e70a916e3c7e06826e706439f44c477a30 Mon Sep 17 00:00:00 2001 From: henning <> Date: Sun, 4 Jul 2004 22:24:20 +0000 Subject: [PATCH] put interval defines in ntpd.h and name them consistently --- src/usr.sbin/ntpd/client.c | 6 +++--- src/usr.sbin/ntpd/ntp.h | 4 +--- src/usr.sbin/ntpd/ntpd.h | 9 ++++++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/usr.sbin/ntpd/client.c b/src/usr.sbin/ntpd/client.c index c1dd2c25..ea706f94 100644 --- a/src/usr.sbin/ntpd/client.c +++ b/src/usr.sbin/ntpd/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.4 2004/07/04 19:52:24 henning Exp $ */ +/* $OpenBSD: client.c,v 1.5 2004/07/04 22:24:20 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -86,7 +86,7 @@ client_query(struct ntp_peer *p) NTP_MSGSIZE_NOAUTH, 0); p->state = STATE_QUERY_SENT; p->next = 0; - p->deadline = time(NULL) + MAX_QUERYTIME; + p->deadline = time(NULL) + QUERYTIME_MAX; return (0); } @@ -139,7 +139,7 @@ client_dispatch(struct ntp_peer *p) p->error = (T2 - T1) - (T3 - T4); p->state = STATE_REPLY_RECEIVED; - p->next = time(NULL) + QUERY_INTERVAL; + p->next = time(NULL) + INTERVAL_QUERY; p->deadline = 0; log_debug("reply received: offset %f error %f", p->offset, p->error); diff --git a/src/usr.sbin/ntpd/ntp.h b/src/usr.sbin/ntpd/ntp.h index 8a3c49ae..61578f84 100644 --- a/src/usr.sbin/ntpd/ntp.h +++ b/src/usr.sbin/ntpd/ntp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ntp.h,v 1.6 2004/07/04 11:01:49 alexander Exp $ */ +/* $OpenBSD: ntp.h,v 1.7 2004/07/04 22:24:20 henning Exp $ */ /* * Copyright (c) 2004 Henning Brauer @@ -145,7 +145,5 @@ struct ntp_query { #define JAN_1970 2208988800UL /* 1970 - 1900 in seconds */ #define NTP_VERSION 4 -#define MAX_QUERYTIME 30 /* max seconds a single query might take */ -#define QUERY_INTERVAL 60 /* sync with peers every n seconds */ #endif /* _NTP_H_ */ diff --git a/src/usr.sbin/ntpd/ntpd.h b/src/usr.sbin/ntpd/ntpd.h index 85fcb273..77316d5a 100644 --- a/src/usr.sbin/ntpd/ntpd.h +++ b/src/usr.sbin/ntpd/ntpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ntpd.h,v 1.8 2004/07/04 11:01:49 alexander Exp $ */ +/* $OpenBSD: ntpd.h,v 1.9 2004/07/04 22:24:20 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -33,8 +33,11 @@ #define IDX2PEER_RESERVE 5 #define PFD_RESERVE 10 -#define NTPD_OPT_VERBOSE 0x0001 -#define NTPD_OPT_VERBOSE2 0x0002 +#define NTPD_OPT_VERBOSE 0x0001 +#define NTPD_OPT_VERBOSE2 0x0002 + +#define INTERVAL_QUERY 60 /* sync with peers every n seconds */ +#define QUERYTIME_MAX 30 /* single query might take n secs max */ enum client_state { STATE_NONE,