PageRenderTime 24ms CodeModel.GetById 12ms app.highlight 8ms RepoModel.GetById 2ms app.codeStats 0ms

/contrib/ntp/sntp/header.h

https://bitbucket.org/freebsd/freebsd-head/
C++ Header | 87 lines | 35 code | 40 blank | 12 comment | 0 complexity | f5db6800ac2f33b9e0f60a7b363b964f MD5 | raw file
 1/*  Copyright (C) 1996 N.M. Maclaren
 2    Copyright (C) 1996 The University of Cambridge
 3
 4This includes all of the 'safe' headers and definitions used across modules.
 5No 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 VERSION         "1.6"          /* Just the version string */
19#define MAX_SOCKETS        10          /* Maximum number of addresses */
20
21#ifndef LOCKNAME
22#    define LOCKNAME "/etc/sntp.pid"  /* Stores the pid */
23#endif
24#ifndef SAVENAME
25#    define SAVENAME "/etc/sntp.state" /* Stores the recovery state */
26#endif
27
28
29
30/* Defined in main.c */
31
32#define op_client           1          /* Behave as a challenge client */
33#define op_listen           2          /* Behave as a listening client */
34
35extern const char *argv0;
36
37extern int verbose, operation;
38
39extern const char *lockname;
40
41extern void fatal (int syserr, const char *message, const char *insert);
42
43
44
45/* Defined in unix.c */
46
47extern void do_nothing (int seconds);
48
49extern int ftty (FILE *file);
50
51extern void set_lock (int lock);
52
53extern void log_message (const char *message);
54
55
56
57/* Defined in internet.c */
58
59/* extern void find_address (struct in_addr *address, int *port, char *hostname,
60    int timespan); */
61
62#define PREF_FAM_INET	1
63#define PREF_FAM_INET6	2
64extern void preferred_family(int);
65
66
67/* Defined in socket.c */
68
69extern void open_socket (int which, char *hostnames, int timespan);
70
71extern void write_socket (int which, void *packet, int length);
72
73extern int read_socket (int which, void *packet, int length, int waiting);
74
75extern int flush_socket (int which);
76
77extern void close_socket (int which);
78
79
80
81/* Defined in timing.c */
82
83extern double current_time (double offset);
84
85extern time_t convert_time (double value, int *millisecs);
86
87extern void adjust_time (double difference, int immediate, double ignore);