Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / external / bsd / ntp / dist / sntp / header.h
blob1ae95ba643f51ac7bdc6532fa12d539b1e0bc8cb
1 /* $NetBSD$ */
3 /* Copyright (C) 1996 N.M. Maclaren
4 Copyright (C) 1996 The University of Cambridge
6 This includes all of the 'safe' headers and definitions used across modules.
7 No changes should be needed for any system that is even remotely like Unix. */
11 #include <ctype.h>
12 #include <errno.h>
13 #include <stdio.h>
14 #include <stdlib.h>
15 #include <string.h>
16 #include <time.h>
20 #define MAX_SOCKETS 10 /* Maximum number of addresses */
22 #ifndef LOCKNAME
23 # define LOCKNAME "/etc/sntp.pid" /* Stores the pid */
24 #endif
25 #ifndef SAVENAME
26 # define SAVENAME "/etc/sntp.state" /* Stores the recovery state */
27 #endif
29 #define DEBUG
33 /* Defined in main.c */
35 #define op_client 1 /* Behave as a challenge client */
36 #define op_listen 2 /* Behave as a listening client */
38 /* extern const char *argv0;
40 extern int verbose, operation;
42 extern const char *lockname;
44 extern void fatal (int syserr, const char *message, const char *insert);
48 Defined in unix.c */
50 extern void do_nothing (int seconds);
52 extern int ftty (FILE *file);
54 extern void set_lock (int lock);
56 extern void log_message (const char *message);
60 /* Defined in internet.c */
62 /* extern void find_address (struct in_addr *address, int *port, char *hostname,
63 int timespan); */
65 #define PREF_FAM_INET 1
66 #define PREF_FAM_INET6 2
67 extern void preferred_family(int);
70 /* Defined in socket.c */
72 extern void open_socket (int which, char *hostnames, int timespan);
74 extern void write_socket (int which, void *packet, int length);
76 extern int read_socket (int which, void *packet, int length, int waiting);
78 extern int flush_socket (int which);
80 /* extern void close_socket (int which); */
84 /* Defined in timing.c */
86 extern double current_time (double offset);
88 extern time_t convert_time (double value, int *millisecs);
90 extern void adjust_time (double difference, int immediate, double ignore);