1 /* $NetBSD: header.h,v 1.2 2003/12/04 16:23:38 drochner Exp $ */
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. */
20 #define VERSION "1.6" /* Just the version string */
21 #define MAX_SOCKETS 10 /* Maximum number of addresses */
24 # define LOCKNAME "/etc/sntp.pid" /* Stores the pid */
27 # define SAVENAME "/etc/sntp.state" /* Stores the recovery state */
32 /* Defined in main.c */
34 #define op_client 1 /* Behave as a challenge client */
35 #define op_listen 2 /* Behave as a listening client */
37 extern const char *argv0
;
39 extern int verbose
, operation
;
41 extern const char *lockname
;
43 extern void fatal (int syserr
, const char *message
, const char *insert
);
47 /* Defined in unix.c */
49 extern void do_nothing (int seconds
);
51 extern int ftty (FILE *file
);
53 extern void set_lock (int lock
);
55 extern void log_message (const char *message
);
59 /* Defined in internet.c */
61 /* extern void find_address (struct in_addr *address, int *port, char *hostname,
64 #define PREF_FAM_INET 1
65 #define PREF_FAM_INET6 2
66 extern void preferred_family(int);
69 /* Defined in socket.c */
71 extern void open_socket (int which
, char *hostnames
, int timespan
);
73 extern void write_socket (int which
, void *packet
, int length
);
75 extern int read_socket (int which
, void *packet
, int length
, int waiting
);
77 extern int flush_socket (int which
);
79 extern void close_socket (int which
);
83 /* Defined in timing.c */
85 extern double current_time (double offset
);
87 extern time_t convert_time (double value
, int *millisecs
);
89 extern void adjust_time (double difference
, int immediate
, double ignore
);