1: /* Copyright (C) 1996 N.M. Maclaren
2: Copyright (C) 1996 The University of Cambridge
3:
4: This includes all of the 'safe' headers and definitions used across modules.
5: No changes should be needed for any system that is even remotely like Unix. */
6:
7:
8:
9: #include <ctype.h>
10: #include <errno.h>
11: #include <stdio.h>
12: #include <stdlib.h>
13: #include <string.h>
14: #include <time.h>
15:
16:
17:
18: #define MAX_SOCKETS 10 /* Maximum number of addresses */
19:
20: #ifndef LOCKNAME
21: # define LOCKNAME "/etc/sntp.pid" /* Stores the pid */
22: #endif
23: #ifndef SAVENAME
24: # define SAVENAME "/etc/sntp.state" /* Stores the recovery state */
25: #endif
26:
27: //#define DEBUG
28:
29:
30:
31: /* Defined in main.c */
32:
33: #define op_client 1 /* Behave as a challenge client */
34: #define op_listen 2 /* Behave as a listening client */
35:
36: /* extern const char *argv0;
37:
38: extern int verbose, operation;
39:
40: extern const char *lockname;
41:
42: extern void fatal (int syserr, const char *message, const char *insert);
43:
44:
45:
46: Defined in unix.c */
47:
48: extern void do_nothing (int seconds);
49:
50: extern int ftty (FILE *file);
51:
52: extern void set_lock (int lock);
53:
54: extern void log_message (const char *message);
55:
56:
57:
58: /* Defined in internet.c */
59:
60: /* extern void find_address (struct in_addr *address, int *port, char *hostname,
61: int timespan); */
62:
63: #define PREF_FAM_INET 1
64: #define PREF_FAM_INET6 2
65: extern void preferred_family(int);
66:
67:
68: /* Defined in socket.c */
69:
70: extern void open_socket (int which, char *hostnames, int timespan);
71:
72: extern void write_socket (int which, void *packet, int length);
73:
74: extern int read_socket (int which, void *packet, int length, int waiting);
75:
76: extern int flush_socket (int which);
77:
78: /* extern void close_socket (int which); */
79:
80:
81:
82: /* Defined in timing.c */
83:
84: extern double current_time (double offset);
85:
86: extern time_t convert_time (double value, int *millisecs);
87:
88: extern void adjust_time (double difference, int immediate, double ignore);
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>