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 MAX_SOCKETS 10 /* Maximum number of addresses */
23 # define LOCKNAME "/etc/sntp.pid" /* Stores the pid */
26 # define SAVENAME "/etc/sntp.state" /* Stores the recovery state */
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);
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,
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
);