1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
|
/*
* ntpd.h - Prototypes for xntpd.
*/
#include "ntp_syslog.h"
#include "ntp_fp.h"
#include "ntp.h"
#include "ntp_malloc.h"
#ifdef SYS_WINNT
#define exit service_exit
extern void service_exit P((int));
/* declare the service threads */
void service_main P((DWORD, LPTSTR *));
void service_ctrl P((DWORD));
void worker_thread P((void *));
#define sleep(x) Sleep((DWORD) x * 1000 /* milliseconds */ );
/* mutex to prevent race condition among threads under Windows NT */
extern HANDLE m_hListMutex;
#define TARGET_RESOLUTION 1 /* Try for 1-millisecond accuracy.
* used in ntp_timer.c
*/
extern long units_per_tick;
#else
#define closesocket close
#endif /* SYS_WINNT */
/* ntp_config.c */
extern void getstartup P((int, char **));
extern void getconfig P((int, char **));
/* ntp_config.c */
extern void ctl_clr_stats P((void));
extern int ctlclrtrap P((struct sockaddr_in *, struct interface *, int));
extern u_short ctlpeerstatus P((struct peer *));
extern int ctlsettrap P((struct sockaddr_in *, struct interface *, int, int));
extern u_short ctlsysstatus P((void));
extern void init_control P((void));
extern void process_control P((struct recvbuf *, int));
extern void report_event P((int, struct peer *));
/* ntp_control.c */
/*
* Structure for translation tables between internal system
* variable indices and text format.
*/
struct ctl_var {
u_short code;
u_short flags;
char *text;
};
/*
* Flag values
*/
#define CAN_READ 0x01
#define CAN_WRITE 0x02
#define DEF 0x20
#define PADDING 0x40
#define EOV 0x80
#define RO (CAN_READ)
#define WO (CAN_WRITE)
#define RW (CAN_READ|CAN_WRITE)
extern char * add_var P((struct ctl_var **, unsigned long, int));
extern void free_varlist P((struct ctl_var *));
extern void set_var P((struct ctl_var **, char *, unsigned long, int));
extern void set_sys_var P((char *, unsigned long, int));
/* ntp_intres.c */
extern void ntp_intres P((void));
/* ntp_io.c */
extern struct interface *findbcastinter P((struct sockaddr_in *));
extern struct interface *findinterface P((struct sockaddr_in *));
extern void freerecvbuf P((struct recvbuf *));
extern struct recvbuf *getrecvbufs P((void));
extern void init_io P((void));
extern void input_handler P((l_fp *));
extern void io_clr_stats P((void));
extern void io_setbclient P((void));
extern void io_unsetbclient P((void));
extern void io_multicast_add P((u_int32));
extern void io_multicast_del P((u_int32));
extern void kill_asyncio P((void));
extern void sendpkt P((struct sockaddr_in *, struct interface *, int, struct pkt *, int));
#ifdef HAVE_SIGNALED_IO
extern void wait_for_signal P((void));
extern void unblock_io_and_alarm P((void));
extern void block_io_and_alarm P((void));
#endif
/* ntp_leap.c */
extern void init_leap P((void));
extern void leap_process P((void));
extern int leap_setleap P((int, int));
/*
* there seems to be a bug in the IRIX 4 compiler which prevents
* u_char from beeing used in prototyped functions.
* This is also true AIX compiler.
* So give up and define it to be int. WLJ
*/
extern int leap_actual P((int));
/* ntp_loopfilter.c */
extern void init_loopfilter P((void));
extern int local_clock P((l_fp *, struct peer *, int));
extern void adj_frequency P((s_fp));
extern void adj_host_clock P((void));
extern void loop_config P((int, l_fp *));
/* refclock_atom.c */
#if defined(REFCLOCK) && defined(ATOM)
extern int pps_sample P((l_fp *));
#endif /* ATOM */
/* ntp_monitor.c */
extern void init_mon P((void));
extern void mon_start P((int));
extern void mon_stop P((int));
extern void ntp_monitor P((struct recvbuf *));
/* ntp_peer.c */
extern void init_peer P((void));
extern struct peer *findexistingpeer P((struct sockaddr_in *, struct peer *));
extern struct peer *findpeer P((struct sockaddr_in *, struct interface *, int));
extern struct peer *findpeerbyassoc P((int));
extern struct peer *newpeer P((struct sockaddr_in *, struct interface *, int, int, int, int, int, u_int32));
extern void peer_all_reset P((void));
extern void peer_clr_stats P((void));
extern struct peer *peer_config P((struct sockaddr_in *, struct interface *, int, int, int, int, int, int, u_int32));
extern void peer_reset P((struct peer *));
extern int peer_unconfig P((struct sockaddr_in *, struct interface *));
extern void unpeer P((struct peer *));
/* ntp_proto.c */
extern void transmit P((struct peer *));
extern void receive P((struct recvbuf *));
extern void peer_clear P((struct peer *));
extern int process_packet P((struct peer *, struct pkt *, l_fp *, int, int));
extern void clock_update P((struct peer *));
/*
* there seems to be a bug in the IRIX 4 compiler which prevents
* u_char from beeing used in prototyped functions.
* This is also true AIX compiler.
* So give up and define it to be int. WLJ
*/
extern void poll_update P((struct peer *, unsigned int, int));
extern void clear P((struct peer *));
extern void clock_filter P((struct peer *, l_fp *, s_fp, u_fp));
extern void clock_select P((void));
extern void clock_combine P((struct peer **, int));
extern void fast_xmit P((struct recvbuf *, int, int));
extern void init_proto P((void));
extern void proto_config P((int, u_long));
extern void proto_clr_stats P((void));
#ifdef REFCLOCK
/* ntp_refclock.c */
extern int refclock_newpeer P((struct peer *));
extern void refclock_unpeer P((struct peer *));
extern void refclock_receive P((struct peer *, l_fp *, s_fp, u_fp, l_fp *, l_fp *, int));
extern void refclock_leap P((void));
extern void init_refclock P((void));
#endif /* REFCLOCK */
/* ntp_request.c */
extern void init_request P((void));
extern void process_private P((struct recvbuf *, int));
/* ntp_restrict.c */
extern void init_restrict P((void));
extern int restrictions P((struct sockaddr_in *));
extern void hack_restrict P((int, struct sockaddr_in *, struct sockaddr_in *, int, int));
/* ntp_timer.c */
extern void init_timer P((void));
extern void timer P((void));
extern void timer_clr_stats P((void));
/* ntp_unixclock.c */
extern void init_systime P((void));
/* ntp_util.c */
extern void init_util P((void));
extern void hourly_stats P((void));
extern void stats_config P((int, char *));
extern void record_peer_stats P((struct sockaddr_in *, int, l_fp *, s_fp, u_fp));
extern void record_loop_stats P((l_fp *, s_fp, unsigned));
extern void record_clock_stats P((struct sockaddr_in *, char *));
extern void record_raw_stats P((struct sockaddr_in *, struct sockaddr_in *, l_fp *, l_fp *, l_fp *, l_fp *));
extern void getauthkeys P((char *));
extern void rereadkeys P((void));
|