Browse Source

put interval defines in ntpd.h and name them consistently

OPENBSD_3_6
henning 20 years ago
parent
commit
43d3d7e70a
3 changed files with 10 additions and 9 deletions
  1. +3
    -3
      src/usr.sbin/ntpd/client.c
  2. +1
    -3
      src/usr.sbin/ntpd/ntp.h
  3. +6
    -3
      src/usr.sbin/ntpd/ntpd.h

+ 3
- 3
src/usr.sbin/ntpd/client.c View File

@ -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 <henning@openbsd.org>
@ -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);


+ 1
- 3
src/usr.sbin/ntpd/ntp.h View File

@ -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 <henning@openbsd.org>
@ -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_ */

+ 6
- 3
src/usr.sbin/ntpd/ntpd.h View File

@ -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 <henning@openbsd.org>
@ -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,


Loading…
Cancel
Save