aboutsummaryrefslogtreecommitdiff
path: root/include/ntpsim.h
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2014-12-20 22:52:39 +0000
committerCy Schubert <cy@FreeBSD.org>2014-12-20 22:52:39 +0000
commitb5e14a1344528861a7016aa2c6b0f2e9630d1526 (patch)
treef04bed14f7e8aed5c0e9d2f7785175c7951036d3 /include/ntpsim.h
parent2b45e011ca352ce509bc83ae148230aeee0c7e0d (diff)
Vendor import ntp 4.2.8.vendor/ntp/4.2.8
Reviewed by: roberto Security: VUXML: 4033d826-87dd-11e4-9079-3c970e169bc2 Security: http://www.kb.cert.org/vuls/id/852879 Security: CVE-2014-9293 Security CVE-2014-9294 Security CVE-2014-9295 Security CVE-2014-9296
Notes
Notes: svn path=/vendor/ntp/dist/; revision=275970 svn path=/vendor/ntp/4.2.8/; revision=275971; tag=vendor/ntp/4.2.8
Diffstat (limited to 'include/ntpsim.h')
-rw-r--r--include/ntpsim.h77
1 files changed, 40 insertions, 37 deletions
diff --git a/include/ntpsim.h b/include/ntpsim.h
index 971c7f16340c..b270ce640b18 100644
--- a/include/ntpsim.h
+++ b/include/ntpsim.h
@@ -26,8 +26,7 @@
#include "recvbuff.h"
#include "ntp_io.h"
#include "ntp_stdlib.h"
-
-#include "ntp_data_structures.h"
+#include "ntp_prio_q.h"
/* CONSTANTS */
@@ -77,26 +76,32 @@ typedef struct {
/* Server Script Information */
+typedef struct script_info_tag script_info;
+struct script_info_tag {
+ script_info * link;
+ double duration;
+ double freq_offset;
+ double wander;
+ double jitter;
+ double prop_delay;
+ double proc_delay;
+};
-typedef struct {
- double duration;
- double freq_offset;
- double wander;
- double jitter;
- double prop_delay;
- double proc_delay;
-} script_info;
-
+typedef DECL_FIFO_ANCHOR(script_info) script_info_fifo;
/* Server Structures */
-typedef struct {
- double server_time; /* Server time */
- sockaddr_u *addr; /* Server Address */
- queue *script; /* Server Script */
- script_info *curr_script; /* Current Script */
-} server_info;
+typedef struct server_info_tag server_info;
+struct server_info_tag {
+ server_info * link;
+ double server_time;
+ sockaddr_u * addr;
+ script_info_fifo * script;
+ script_info * curr_script;
+};
+
+typedef DECL_FIFO_ANCHOR(server_info) server_info_fifo;
/* Simulation control information */
@@ -114,30 +119,28 @@ typedef struct Sim_Info {
/* Local Clock (Client) Variables */
typedef struct Local_Clock_Info {
- double local_time; /* Client disciplined time */
- double adj; /* Remaining time correction */
- double slew; /* Correction Slew Rate */
- double last_read_time; /* Last time the clock was read */
+ double local_time; /* Client disciplined time */
+ double adj; /* Remaining time correction */
+ double slew; /* Correction Slew Rate */
+ double last_read_time; /* Last time the clock was read */
} local_clock_info;
-extern local_clock_info simclock; /* Local Clock Variables */
-extern sim_info simulation; /* Simulation Control Variables */
+extern local_clock_info simclock; /* Local Clock Variables */
+extern sim_info simulation; /* Simulation Control Variables */
/* Function Prototypes */
-int ntpsim (int argc, char *argv[]);
-Event *event (double t, funcTkn f);
-void sim_event_timer (Event *e);
-int simulate_server (sockaddr_u *serv_addr,
- struct interface *inter,
- struct pkt *rpkt);
-void sim_update_clocks (Event *e);
-void sim_event_recv_packet (Event *e);
-void sim_event_beep (Event *e);
-void abortsim (char *errmsg);
-double gauss (double, double);
-double poisson (double, double);
-int yyparse (void);
-void create_server_associations (void);
+int ntpsim (int argc, char *argv[]);
+Event *event (double t, funcTkn f);
+void sim_event_timer (Event *e);
+int simulate_server (sockaddr_u *serv_addr, endpt *inter,
+ struct pkt *rpkt);
+void sim_update_clocks (Event *e);
+void sim_event_recv_packet (Event *e);
+void sim_event_beep (Event *e);
+void abortsim (char *errmsg);
+double gauss (double, double);
+double poisson (double, double);
+void create_server_associations(void);
#endif /* NTPSIM_H */