4 * ntpsim.h - Prototypes for ntpsim
12 #include <sys/socket.h>
13 #include <arpa/inet.h>
14 #include "ntp_syslog.h"
17 #include "ntp_select.h"
18 #include "ntp_malloc.h"
19 #include "ntp_refclock.h"
22 #include "ntp_stdlib.h"
24 #define PI 3.1415926535
30 BEEP
, CLOCK
, TIMER
, PACKET
37 struct recvbuf evnt_buf
;
39 #define ntp_pkt buffer.evnt_pkt
40 #define rcv_buf buffer.evnt_buf
50 double time
; /* simulation time */
51 double sim_time
; /* end simulation time */
52 double ntp_time
; /* client disciplined time */
53 double adj
; /* remaining time correction */
54 double slew
; /* correction slew rate */
56 double clk_time
; /* server time */
57 double ferr
; /* frequency errort */
58 double fnse
; /* random walk noise */
59 double ndly
; /* network delay */
60 double snse
; /* phase noise */
61 double pdly
; /* processing delay */
62 double bdly
; /* beep interval */
64 double last_time
; /* last clock read time */
65 Queue events
; /* Node Event Queue */
66 struct recvbuf
*rbuflist
; /* Node Receive Buffer */
72 int ntpsim
P((int argc
, char *argv
[]));
73 Event event
P((double, funcTkn
));
74 Queue queue
P((Event
, Queue
));
76 void push
P((Event
, Queue
*));
77 Event pop
P((Queue
*));
78 void ndbeep
P((Node
*, Event
));
79 void ndeclk
P((Node
*, Event
));
80 void ntptmr
P((Node
*, Event
));
81 void netpkt
P((Node
*, Event
));
82 int srvr_rply
P((Node
*, struct sockaddr_storage
*,
83 struct interface
*, struct pkt
*));
84 double gauss
P((double, double));
85 double poisson
P((double, double));
86 int node_clock
P((Node
*, double));
87 void abortsim
P((char *));