+* [Bug 824] New parser code has some build problems with the SIM code.
* [Bug 817] Use longnames for setting ntp variables on the command-line;
Allowing '-v' with and without an arg to disambiguate usage
is error-prone.
#define __NTP_CONFIG_H__
#include "ntp_data_structures.h"
-#ifdef SIM
- #include "ntpsim.h"
-#endif
+#include "ntpsim.h"
/*
struct sim_node *create_sim_node(queue *init_opts, queue *servers);
struct setvar_node *create_setvar_node(char *var, char *val, u_short def);
-#ifdef SIM
script_info *create_sim_script_info(double duration, queue *script_queue);
server_info *create_sim_server(struct address_node *addr, double server_offset, queue *script);
-#endif
extern struct REMOTE_CONFIG_INFO remote_config;
void config_remotely(void);
/* CONSTANTS */
+#ifdef PI
+# undef PI
+#endif
#define PI 3.1415926535 /* The world's most famous constant */
#define SIM_TIME 86400 /* end simulation time */
#define NET_DLY .001 /* network delay */
int yyparse (void);
void create_server_associations (void);
-
#endif
-
-
-
#include "ntp_parser.h"
#include "ntp_data_structures.h"
+void yyerror (char *msg);
+
extern int priority_done;
script_info *create_sim_script_info(double duration, queue *script_queue)
{
+#ifdef SIM
+ return NULL;
+#else
script_info *my_info;
struct attr_val *my_attr_val;
my_info = (script_info *)get_node(sizeof(script_info));
+ /* XXX: check the return value... */
/* Initialize Script Info with default values*/
my_info->duration = duration;
}
destroy_queue(script_queue);
return (my_info);
+#endif
}
server_info *create_sim_server(struct address_node *addr, double server_offset, queue *script)
{
+#ifdef SIM
+ return NULL;
+#else
server_info *my_info;
my_info = (server_info *) get_node(sizeof(server_info));
my_info->script = script;
my_info->curr_script = dequeue(my_info->script);
return my_info;
+#endif /* SIM */
}
struct sim_node *create_sim_node(queue *init_opts, queue *servers)
return new_node + 1;
}
else
- return NULL;
+ return NULL; /* XXX: log this! */
}
/* Define a function to free the allocated memory for a queue node */
-/* A Bison parser, made from /backroom/ntp-dev/A.whimsy/ntpd/../../ntpd/ntp_parser.y
+/* A Bison parser, made from /deacon/backroom/ntp-dev/A.whimsy/ntpd/../../ntpd/ntp_parser.y
by GNU bison 1.35. */
#define YYBISON 1 /* Identify Bison output. */
break;
case 209:
#line 892 "ntp_parser.y"
-{ yyval.Sim_server = create_sim_server(yyvsp[-4].Address_node, yyvsp[-2].Double, yyvsp[-1].Queue); }
+{ yyval.Sim_server = create_sim_server(yyvsp[-4].Address_node, yyvsp[-2].Double, yyvsp[-1].Queue); }
break;
case 210:
#line 896 "ntp_parser.y"
sim_server
: sim_server_name '{' sim_server_offset sim_act_list '}'
- { $$ = create_sim_server($1, $3, $4); }
+ { $$ = create_sim_server($1, $3, $4); }
;
sim_server_offset
/*** TODO: Need to decide on how to output for multiple servers ***/
void sim_event_beep(Event *e)
{
+#if 0
static int first_time = 1;
char *dash = "-----------------";
+#endif
+
fprintf(stderr, "BEEP!!!\n");
enqueue(event_queue, event(e->time + simulation.beep_delay, BEEP));
-/*
+#if 0
if(simulation.beep_delay > 0) {
if (first_time) {
printf("\t%4c T %4c\t%4c T+ERR %3c\t%5cT+ERR+NTP\n",
simclock.local_time,
n->time, n->clk_time, n->ntp_time);
-*/
+#endif
}