xref: /freebsd/contrib/ntp/include/ntpd.h (revision f6a3b357e9be4c6423c85eff9a847163a0d307c8)
1 /*
2  * ntpd.h - Prototypes and external variables for ntpd.
3  *
4  * Note the first half is primarily function prototypes, type
5  * declarations, and preprocessor macros, with variables declared
6  * primarily in the second half.
7  *
8  * Each half is further divided into sections for each source file.
9  */
10 
11 #include "ntp.h"
12 #include "ntp_stdlib.h"
13 #include "ntp_syslog.h"
14 #include "ntp_debug.h"
15 #include "ntp_syslog.h"
16 #include "ntp_select.h"
17 #include "ntp_malloc.h"
18 #include "ntp_refclock.h"
19 #include "ntp_intres.h"
20 #include "recvbuff.h"
21 
22 /*
23  * First half: ntpd types, functions, macros
24  * -----------------------------------------
25  */
26 
27 /*
28  * macro for debugging output - cut down on #ifdef pollution.
29  *
30  * DPRINTF() is for use by ntpd only, and compiles away to nothing
31  * without DEBUG (configure --disable-debugging).
32  *
33  * TRACE() is similar for libntp and utilities, which retain full
34  * debug capability even when compiled without DEBUG.
35  *
36  * The calling convention is not attractive:
37  *     DPRINTF(debuglevel, (fmt, ...));
38  *     DPRINTF(2, ("shows #ifdef DEBUG and if debug >= %d\n", 2));
39  */
40 #ifdef DEBUG
41 # define DPRINTF(lvl, arg)				\
42 	do { 						\
43 		if (debug >= (lvl))			\
44 			mprintf arg;			\
45 	} while (0)
46 #else
47 # define DPRINTF(lvl, arg)	do {} while (0)
48 #endif
49 
50 
51 /* nt_clockstuff.c */
52 #ifdef SYS_WINNT
53 extern	void	win_time_stepped(void);
54 #endif
55 
56 /* ntp_config.c */
57 #define	TAI_1972	10	/* initial TAI offset (s) */
58 extern	char	*keysdir;	/* crypto keys and leaptable directory */
59 extern	char *	saveconfigdir;	/* ntpq saveconfig output directory */
60 
61 extern	void	getconfig	(int, char **);
62 extern	void	ctl_clr_stats	(void);
63 extern	int	ctlclrtrap	(sockaddr_u *, struct interface *, int);
64 extern	u_short ctlpeerstatus	(struct peer *);
65 extern	int	ctlsettrap	(sockaddr_u *, struct interface *, int, int);
66 extern	u_short ctlsysstatus	(void);
67 extern	void	init_control	(void);
68 extern	void	process_control (struct recvbuf *, int);
69 extern	void	report_event	(int, struct peer *, const char *);
70 extern	int	mprintf_event	(int, struct peer *, const char *, ...)
71 			NTP_PRINTF(3, 4);
72 
73 /* ntp_control.c */
74 /*
75  * Structure for translation tables between internal system
76  * variable indices and text format.
77  */
78 struct ctl_var {
79 	u_short code;
80 	u_short flags;
81 	const char *text;
82 };
83 /*
84  * Flag values
85  */
86 #define	CAN_READ	0x01
87 #define	CAN_WRITE	0x02
88 
89 #define DEF		0x20
90 #define	PADDING		0x40
91 #define	EOV		0x80
92 
93 #define	RO	(CAN_READ)
94 #define	WO	(CAN_WRITE)
95 #define	RW	(CAN_READ|CAN_WRITE)
96 
97 extern	char *	add_var (struct ctl_var **, u_long, u_short);
98 extern	void	free_varlist (struct ctl_var *);
99 extern	void	set_var (struct ctl_var **, const char *, u_long, u_short);
100 extern	void	set_sys_var (const char *, u_long, u_short);
101 extern	const char *	get_ext_sys_var(const char *tag);
102 
103 /* ntp_io.c */
104 typedef struct interface_info {
105 	endpt *	ep;
106 	u_char	action;
107 } interface_info_t;
108 
109 typedef void	(*interface_receiver_t)	(void *, interface_info_t *);
110 
111 extern	void	interface_enumerate	(interface_receiver_t, void *);
112 extern	endpt *	getinterface		(sockaddr_u *, u_int32);
113 extern	endpt *	select_peerinterface	(struct peer *, sockaddr_u *,
114 					 endpt *);
115 extern	endpt *	findinterface		(sockaddr_u *);
116 extern	endpt *	findbcastinter		(sockaddr_u *);
117 extern	void	enable_broadcast	(endpt *, sockaddr_u *);
118 extern	void	enable_multicast_if	(endpt *, sockaddr_u *);
119 extern	void	interface_update	(interface_receiver_t, void *);
120 #ifndef HAVE_IO_COMPLETION_PORT
121 extern  void    io_handler              (void);
122 #endif
123 extern	void	init_io 	(void);
124 extern	void	io_open_sockets	(void);
125 extern	void	io_clr_stats	(void);
126 extern	void	io_setbclient	(void);
127 extern	void	io_unsetbclient	(void);
128 extern	void	io_multicast_add(sockaddr_u *);
129 extern	void	io_multicast_del(sockaddr_u *);
130 extern	void	sendpkt 	(sockaddr_u *, struct interface *, int, struct pkt *, int);
131 #ifdef DEBUG
132 extern	void	collect_timing  (struct recvbuf *, const char *, int, l_fp *);
133 #endif
134 #ifdef HAVE_SIGNALED_IO
135 extern	void	wait_for_signal		(void);
136 extern	void	unblock_io_and_alarm	(void);
137 extern	void	block_io_and_alarm	(void);
138 # define	UNBLOCK_IO_AND_ALARM()	unblock_io_and_alarm()
139 # define	BLOCK_IO_AND_ALARM()	block_io_and_alarm()
140 #else
141 # define	UNBLOCK_IO_AND_ALARM()	do {} while (0)
142 # define	BLOCK_IO_AND_ALARM()	do {} while (0)
143 #endif
144 #define		latoa(pif)	localaddrtoa(pif)
145 extern const char * localaddrtoa(endpt *);
146 
147 /* ntp_loopfilter.c */
148 extern	void	init_loopfilter(void);
149 extern	int 	local_clock(struct peer *, double);
150 extern	void	adj_host_clock(void);
151 extern	void	loop_config(int, double);
152 extern	void	select_loop(int);
153 extern	void	huffpuff(void);
154 extern	u_long	sys_clocktime;
155 extern	u_int	sys_tai;
156 extern 	int	freq_cnt;
157 
158 /* ntp_monitor.c */
159 #define MON_HASH_SIZE		((size_t)1U << mon_hash_bits)
160 #define MON_HASH_MASK		(MON_HASH_SIZE - 1)
161 #define	MON_HASH(addr)		(sock_hash(addr) & MON_HASH_MASK)
162 extern	void	init_mon	(void);
163 extern	void	mon_start	(int);
164 extern	void	mon_stop	(int);
165 extern	u_short	ntp_monitor	(struct recvbuf *, u_short);
166 extern	void	mon_clearinterface(endpt *interface);
167 
168 /* ntp_peer.c */
169 extern	void	init_peer	(void);
170 extern	struct peer *findexistingpeer(sockaddr_u *, const char *,
171 				      struct peer *, int, u_char, int *);
172 extern	struct peer *findpeer	(struct recvbuf *, int, int *);
173 extern	struct peer *findpeerbyassoc(associd_t);
174 extern  void	set_peerdstadr	(struct peer *, endpt *);
175 extern	struct peer *newpeer	(sockaddr_u *, const char *, endpt *,
176 				 int, u_char, u_char, u_char, u_char,
177 				 u_int, u_char, u_int32,
178 				 keyid_t, const char *);
179 extern	void	peer_all_reset	(void);
180 extern	void	peer_clr_stats	(void);
181 extern	struct peer *peer_config(sockaddr_u *, const char *, endpt *,
182 				 int, u_char, u_char, u_char, u_char,
183 				 u_int, u_int32,
184 				 keyid_t, const char *);
185 extern	void	peer_reset	(struct peer *);
186 extern	void	refresh_all_peerinterfaces(void);
187 extern	void	unpeer		(struct peer *);
188 extern	void	clear_all	(void);
189 extern	int	score_all	(struct peer *);
190 extern	struct peer *findmanycastpeer(struct recvbuf *);
191 extern	void	peer_cleanup	(void);
192 
193 /* ntp_crypto.c */
194 #ifdef AUTOKEY
195 extern	int	crypto_recv	(struct peer *, struct recvbuf *);
196 extern	int	crypto_xmit	(struct peer *, struct pkt *,
197 				    struct recvbuf *, int,
198 				    struct exten *, keyid_t);
199 extern	keyid_t	session_key	(sockaddr_u *, sockaddr_u *, keyid_t,
200 				    keyid_t, u_long);
201 extern	int	make_keylist	(struct peer *, struct interface *);
202 extern	void	key_expire	(struct peer *);
203 extern	void	crypto_update	(void);
204 extern	void	crypto_update_taichange(void);
205 extern	void	crypto_config	(int, char *);
206 extern	void	crypto_setup	(void);
207 extern	u_int	crypto_ident	(struct peer *);
208 extern	struct exten *crypto_args (struct peer *, u_int, associd_t, char *);
209 extern	int	crypto_public	(struct peer *, u_char *, u_int);
210 extern	void	value_free	(struct value *);
211 extern	char	*iffpar_file;
212 extern	EVP_PKEY *iffpar_pkey;
213 extern	char	*gqpar_file;
214 extern	EVP_PKEY *gqpar_pkey;
215 extern	char	*mvpar_file;
216 extern	EVP_PKEY *mvpar_pkey;
217 extern struct value tai_leap;
218 #endif	/* AUTOKEY */
219 
220 /* ntp_proto.c */
221 extern	void	transmit	(struct peer *);
222 extern	void	receive 	(struct recvbuf *);
223 extern	void	peer_clear	(struct peer *, const char *);
224 extern	void 	process_packet	(struct peer *, struct pkt *, u_int);
225 extern	void	clock_select	(void);
226 extern	void	set_sys_leap	(u_char);
227 
228 extern	u_long	leapsec;	/* seconds to next leap (proximity class) */
229 extern  int     leapdif;        /* TAI difference step at next leap second*/
230 extern	int	sys_orphan;
231 extern	double	sys_mindisp;
232 extern	double	sys_maxdist;
233 
234 extern	char	*sys_ident;	/* identity scheme */
235 extern	void	poll_update	(struct peer *, u_char);
236 
237 extern	void	clear		(struct peer *);
238 extern	void	clock_filter	(struct peer *, double, double, double);
239 extern	void	init_proto	(void);
240 extern	void	set_sys_tick_precision(double);
241 extern	void	proto_config	(int, u_long, double, sockaddr_u *);
242 extern	void	proto_clr_stats (void);
243 
244 /* ntp_refclock.c */
245 #ifdef	REFCLOCK
246 extern	int	refclock_newpeer (struct peer *);
247 extern	void	refclock_unpeer (struct peer *);
248 extern	void	refclock_receive (struct peer *);
249 extern	void	refclock_transmit (struct peer *);
250 extern	void	init_refclock	(void);
251 #endif	/* REFCLOCK */
252 
253 /* ntp_request.c */
254 extern	void	init_request	(void);
255 extern	void	process_private (struct recvbuf *, int);
256 extern	void	reset_auth_stats(void);
257 
258 /* ntp_restrict.c */
259 extern	void	init_restrict	(void);
260 extern	void	restrictions	(sockaddr_u *, r4addr *);
261 extern	void	hack_restrict	(restrict_op, sockaddr_u *, sockaddr_u *,
262 				 short, u_short, u_short, u_long);
263 extern	void	restrict_source	(sockaddr_u *, int, u_long);
264 extern	void	dump_restricts	(void);
265 
266 /* ntp_timer.c */
267 extern	void	init_timer	(void);
268 extern	void	reinit_timer	(void);
269 extern	void	timer		(void);
270 extern	void	timer_clr_stats (void);
271 extern	void	timer_interfacetimeout (u_long);
272 extern	volatile int interface_interval;
273 extern	u_long	orphwait;		/* orphan wait time */
274 #ifdef AUTOKEY
275 extern	char	*sys_hostname;	/* host name */
276 extern	char	*sys_groupname;	/* group name */
277 extern	char	*group_name;	/* group name */
278 extern	u_char	sys_revoke;	/* keys revoke timeout */
279 extern	u_char	sys_automax;	/* session key timeout */
280 #endif	/* AUTOKEY */
281 
282 /* ntp_util.c */
283 extern	void	init_util	(void);
284 extern	void	write_stats	(void);
285 extern	void	stats_config	(int, const char *);
286 extern	void	record_peer_stats (sockaddr_u *, int, double, double, double, double);
287 extern	void	record_proto_stats (char *);
288 extern	void	record_loop_stats (double, double, double, double, int);
289 extern	void	record_clock_stats (sockaddr_u *, const char *);
290 extern	int	mprintf_clock_stats(sockaddr_u *, const char *, ...)
291 			NTP_PRINTF(2, 3);
292 extern	void	record_raw_stats (sockaddr_u *srcadr, sockaddr_u *dstadr, l_fp *t1, l_fp *t2, l_fp *t3, l_fp *t4, int leap, int version, int mode, int stratum, int ppoll, int precision, double root_delay, double root_dispersion, u_int32 refid, int len, u_char *extra);
293 extern	void	check_leap_file	(int is_daily_check, u_int32 ntptime, const time_t * systime);
294 extern	void	record_crypto_stats (sockaddr_u *, const char *);
295 #ifdef DEBUG
296 extern	void	record_timing_stats (const char *);
297 #endif
298 extern	char *	fstostr(time_t);	/* NTP timescale seconds */
299 
300 /* ntpd.c */
301 extern	void	parse_cmdline_opts(int *, char ***);
302 /*
303  * Signals we catch for debugging.
304  */
305 #define MOREDEBUGSIG	SIGUSR1
306 #define LESSDEBUGSIG	SIGUSR2
307 /*
308  * Signals which terminate us gracefully.
309  */
310 #ifndef SYS_WINNT
311 # define SIGDIE1	SIGHUP
312 # define SIGDIE2	SIGINT
313 # define SIGDIE3	SIGQUIT
314 # define SIGDIE4	SIGTERM
315 #endif /* SYS_WINNT */
316 
317 
318 /*
319  * Last half: ntpd variables
320  * -------------------------
321  */
322 
323 /* ntp_config.c */
324 extern char const *	progname;
325 extern int saved_argc;
326 extern char **saved_argv;
327 extern char	*sys_phone[];		/* ACTS phone numbers */
328 #if defined(HAVE_SCHED_SETSCHEDULER)
329 extern int	config_priority_override;
330 extern int	config_priority;
331 #endif
332 extern char *ntp_signd_socket;
333 extern struct config_tree_tag *cfg_tree_history;
334 
335 #ifdef BC_LIST_FRAMEWORK_NOT_YET_USED
336 /*
337  * backwards compatibility flags
338  */
339 typedef struct bc_entry_tag {
340 	int	token;
341 	int	enabled;
342 } bc_entry;
343 
344 extern bc_entry bc_list[];
345 #endif
346 
347 /* ntp_control.c */
348 extern int	num_ctl_traps;
349 extern keyid_t	ctl_auth_keyid;		/* keyid used for authenticating write requests */
350 
351 /*
352  * Statistic counters to keep track of requests and responses.
353  */
354 extern u_long	ctltimereset;		/* time stats reset */
355 extern u_long	numctlreq;		/* number of requests we've received */
356 extern u_long	numctlbadpkts;		/* number of bad control packets */
357 extern u_long	numctlresponses; 	/* number of resp packets sent with data */
358 extern u_long	numctlfrags; 		/* number of fragments sent */
359 extern u_long	numctlerrors;		/* number of error responses sent */
360 extern u_long	numctltooshort;		/* number of too short input packets */
361 extern u_long	numctlinputresp; 	/* number of responses on input */
362 extern u_long	numctlinputfrag; 	/* number of fragments on input */
363 extern u_long	numctlinputerr;		/* number of input pkts with err bit set */
364 extern u_long	numctlbadoffset; 	/* number of input pkts with nonzero offset */
365 extern u_long	numctlbadversion;	/* number of input pkts with unknown version */
366 extern u_long	numctldatatooshort;	/* data too short for count */
367 extern u_long	numctlbadop; 		/* bad op code found in packet */
368 extern u_long	numasyncmsgs;		/* number of async messages we've sent */
369 
370 /*
371  * Other statistics of possible interest
372  */
373 extern volatile u_long packets_dropped;	/* total number of packets dropped on reception */
374 extern volatile u_long packets_ignored;	/* packets received on wild card interface */
375 extern volatile u_long packets_received;/* total number of packets received */
376 extern u_long	packets_sent;		/* total number of packets sent */
377 extern u_long	packets_notsent; 	/* total number of packets which couldn't be sent */
378 
379 extern volatile u_long handler_calls;	/* number of calls to interrupt handler */
380 extern volatile u_long handler_pkts;	/* number of pkts received by handler */
381 extern u_long	io_timereset;		/* time counters were reset */
382 
383 /* ntp_io.c */
384 extern  int	disable_dynamic_updates;
385 extern u_int	sys_ifnum;		/* next .ifnum to assign */
386 extern endpt *	any_interface;		/* IPv4 wildcard */
387 extern endpt *	any6_interface;		/* IPv6 wildcard */
388 extern endpt *	loopback_interface;	/* IPv4 loopback for refclocks */
389 extern endpt *	ep_list;		/* linked list */
390 
391 /* ntp_loopfilter.c */
392 extern double	drift_comp;		/* clock frequency (s/s) */
393 extern double	clock_stability;	/* clock stability (s/s) */
394 extern double	clock_max_back;		/* max backward offset before step (s) */
395 extern double	clock_max_fwd;		/* max forward offset before step (s) */
396 extern double	clock_panic;		/* max offset before panic (s) */
397 extern double	clock_phi;		/* dispersion rate (s/s) */
398 extern double	clock_minstep;		/* step timeout (s) */
399 extern double	clock_codec;		/* codec frequency */
400 #ifdef KERNEL_PLL
401 extern int	pll_status;		/* status bits for kernel pll */
402 #endif /* KERNEL_PLL */
403 
404 /*
405  * Clock state machine control flags
406  */
407 extern int	ntp_enable;		/* clock discipline enabled */
408 extern int	pll_control;		/* kernel support available */
409 extern int	kern_enable;		/* kernel support enabled */
410 extern int	hardpps_enable;		/* kernel PPS discipline enabled */
411 extern int	ext_enable;		/* external clock enabled */
412 extern int	cal_enable;		/* refclock calibrate enable */
413 extern int	allow_panic;		/* allow panic correction (-g) */
414 extern int	enable_panic_check;	/* Can we check allow_panic's state? */
415 extern int	force_step_once;	/* always step time once at startup (-G) */
416 extern int	mode_ntpdate;		/* exit on first clock set (-q) */
417 extern int	peer_ntpdate;		/* count of ntpdate peers */
418 
419 /*
420  * Clock state machine variables
421  */
422 extern u_char	sys_poll;		/* system poll interval (log2 s) */
423 extern int	state;			/* clock discipline state */
424 extern int	tc_counter;		/* poll-adjust counter */
425 extern u_long	last_time;		/* time of last clock update (s) */
426 extern double	last_offset;		/* last clock offset (s) */
427 extern u_char	allan_xpt;		/* Allan intercept (log2 s) */
428 extern double	clock_jitter;		/* clock jitter (s) */
429 extern double	sys_offset;		/* system offset (s) */
430 extern double	sys_jitter;		/* system jitter (s) */
431 
432 /* ntp_monitor.c */
433 extern u_char	mon_hash_bits;		/* log2 size of hash table */
434 extern mon_entry ** mon_hash;		/* MRU hash table */
435 extern mon_entry mon_mru_list;		/* mru listhead */
436 extern u_int	mon_enabled;		/* MON_OFF (0) or other MON_* */
437 extern u_int	mru_alloc;		/* mru list + free list count */
438 extern u_int	mru_entries;		/* mru list count */
439 extern u_int	mru_peakentries;	/* highest mru_entries */
440 extern u_int	mru_initalloc;		/* entries to preallocate */
441 extern u_int	mru_incalloc;		/* allocation batch factor */
442 extern u_int	mru_mindepth;		/* preempt above this */
443 extern int	mru_maxage;		/* for entries older than */
444 extern u_int	mru_maxdepth; 		/* MRU size hard limit */
445 extern int	mon_age;		/* preemption limit */
446 
447 /* ntp_peer.c */
448 extern struct peer *peer_hash[NTP_HASH_SIZE];	/* peer hash table */
449 extern int	peer_hash_count[NTP_HASH_SIZE];	/* count of in each bucket */
450 extern struct peer *assoc_hash[NTP_HASH_SIZE];	/* association ID hash table */
451 extern int	assoc_hash_count[NTP_HASH_SIZE];/* count of in each bucket */
452 extern struct peer *peer_list;		/* peer structures list */
453 extern int	peer_count;		/* count in peer_list */
454 extern int	peer_free_count;	/* count in peer_free */
455 
456 /*
457  * Miscellaneous statistic counters which may be queried.
458  */
459 extern u_long	peer_timereset;		/* time stat counters were zeroed */
460 extern u_long	findpeer_calls;		/* number of calls to findpeer */
461 extern u_long	assocpeer_calls;	/* number of calls to findpeerbyassoc */
462 extern u_long	peer_allocations;	/* number of allocations from the free list */
463 extern u_long	peer_demobilizations;	/* number of structs freed to free list */
464 extern int	total_peer_structs;	/* number of peer structs in circulation */
465 extern int	peer_associations;	/* mobilized associations */
466 extern int	peer_preempt;		/* preemptable associations */
467 
468 /* ntp_proto.c */
469 /*
470  * System variables are declared here.	See Section 3.2 of the
471  * specification.
472  */
473 extern u_char	sys_leap;		/* system leap indicator */
474 extern u_char	sys_stratum;		/* system stratum */
475 extern s_char	sys_precision;		/* local clock precision */
476 extern double	sys_rootdelay;		/* roundtrip delay to primary source */
477 extern double	sys_rootdisp;		/* dispersion to primary source */
478 extern u_int32	sys_refid;		/* reference id */
479 extern l_fp	sys_reftime;		/* last update time */
480 extern struct peer *sys_peer;		/* current peer */
481 
482 /*
483  * Nonspecified system state variables.
484  */
485 extern int	sys_bclient;		/* we set our time to broadcasts */
486 extern double	sys_bdelay; 		/* broadcast client default delay */
487 extern int	sys_authenticate;	/* requre authentication for config */
488 extern l_fp	sys_authdelay;		/* authentication delay */
489 extern u_char	sys_bcpollbstep;	/* broadcast poll backstep gate */
490 extern u_long 	sys_epoch;		/* last clock update time */
491 extern keyid_t	sys_private;		/* private value for session seed */
492 extern int	sys_manycastserver;	/* respond to manycast client pkts */
493 extern int	sys_maxclock;		/* maximum survivors */
494 extern int	sys_minclock;		/* minimum survivors */
495 extern int	sys_minsane;		/* minimum candidates */
496 extern int	sys_floor;		/* cluster stratum floor */
497 extern int	sys_ceiling;		/* cluster stratum ceiling */
498 extern u_char	sys_ttl[MAX_TTL];	/* ttl mapping vector */
499 extern u_int	sys_ttlmax;		/* max ttl mapping vector index */
500 
501 /*
502  * Statistics counters
503  */
504 extern u_long	sys_badauth;		/* bad authentication */
505 extern u_long	sys_badlength;		/* bad length or format */
506 extern u_long	sys_declined;		/* declined */
507 extern u_long	sys_kodsent;		/* KoD sent */
508 extern u_long	sys_lamport;		/* Lamport violation */
509 extern u_long	sys_limitrejected;	/* rate exceeded */
510 extern u_long	sys_newversion;		/* current version  */
511 extern u_long	sys_oldversion;		/* old version */
512 extern u_long	sys_processed;		/* packets for this host */
513 extern u_long	sys_received;		/* packets received */
514 extern u_long	sys_restricted;		/* access denied */
515 extern u_long	sys_stattime;		/* time since reset */
516 extern u_long	sys_tsrounding;		/* timestamp rounding errors */
517 
518 /* ntp_request.c */
519 extern keyid_t	info_auth_keyid;	/* keyid used to authenticate requests */
520 extern u_long	auth_timereset;
521 
522 /* ntp_restrict.c */
523 extern restrict_u *	restrictlist4;	/* IPv4 restriction list */
524 extern restrict_u *	restrictlist6;	/* IPv6 restriction list */
525 extern int		ntp_minpkt;
526 extern u_char		ntp_minpoll;
527 
528 /* ntp_scanner.c */
529 extern u_int32		conf_file_sum;	/* Simple sum of characters */
530 
531 /* ntp_signd.c */
532 #ifdef HAVE_NTP_SIGND
533 extern void send_via_ntp_signd(struct recvbuf *, int, keyid_t, int,
534 			       struct pkt *);
535 #endif
536 
537 /* ntp_timer.c */
538 extern volatile int alarm_flag;		/* alarm flag */
539 extern volatile u_long alarm_overflow;
540 extern u_long	current_time;		/* seconds since startup */
541 extern u_long	timer_timereset;
542 extern u_long	timer_overflows;
543 extern u_long	timer_xmtcalls;
544 extern int	leap_sec_in_progress;
545 #ifdef LEAP_SMEAR
546 extern struct leap_smear_info leap_smear;
547 extern int	leap_smear_intv;
548 #endif
549 #ifdef SYS_WINNT
550 HANDLE WaitableTimerHandle;
551 #endif
552 
553 /* ntp_util.c */
554 extern	char	statsdir[MAXFILENAME];
555 extern	int	stats_control;		/* write stats to fileset? */
556 extern	int	stats_write_period;	/* # of seconds between writes. */
557 extern	double	stats_write_tolerance;
558 extern	double	wander_threshold;
559 
560 /* ntpd.c */
561 extern	int	nofork;		/* no-fork flag */
562 extern	int	initializing;	/* initializing flag */
563 #ifdef HAVE_DROPROOT
564 extern	int	droproot;	/* flag: try to drop root privileges after startup */
565 extern	int	root_dropped;	/* root has been dropped */
566 extern char *user;		/* user to switch to */
567 extern char *group;		/* group to switch to */
568 extern const char *chrootdir;	/* directory to chroot() to */
569 #endif
570 #ifdef HAVE_WORKING_FORK
571 extern	int	waitsync_fd_to_close;	/* -w/--wait-sync */
572 #endif
573 
574 /* ntservice.c */
575 #ifdef SYS_WINNT
576 extern int accept_wildcard_if_for_winnt;
577 #endif
578 
579 /* refclock_conf.c */
580 #ifdef REFCLOCK
581 /* refclock configuration table */
582 extern struct refclock * const refclock_conf[];
583 extern u_char	num_refclock_conf;
584 #endif
585 
586