#include "lib/resource.h"
#include "lib/socket.h"
#include "lib/event.h"
+#include "lib/timer.h"
#include "lib/string.h"
#include "nest/route.h"
#include "nest/protocol.h"
* Debugging
*/
-#ifdef DEBUGGING
-static int debug_flag = 1;
-#else
-static int debug_flag = 0;
-#endif
-
void
async_dump(void)
{
rdump(&root_pool);
sk_dump_all();
- tm_dump_all();
+ // XXXX tm_dump_all();
if_dump_all();
neigh_dump_all();
rta_dump_all();
if (*p == '#' || *p == '\n' || *p == 0)
continue;
-
+
if (sscanf(p, "0x%x %s\n", &val, name) != 2 &&
sscanf(p, "0x%x %s #", &val, name) != 2 &&
sscanf(p, "%d %s\n", &val, name) != 2 &&
int
sysdep_commit(struct config *new, struct config *old UNUSED)
{
- log_switch(debug_flag, &new->logfiles, new->syslog_name);
+ log_switch(0, &new->logfiles, new->syslog_name);
return 0;
}
if (!unix_read_config(&conf, config_name))
{
if (conf->err_msg)
- die("%s, line %d: %s", conf->err_file_name, conf->err_lino, conf->err_msg);
+ die("%s:%d:%d %s", conf->err_file_name, conf->err_lino, conf->err_chno, conf->err_msg);
else
die("Unable to open configuration file %s: %m", config_name);
}
if (!unix_read_config(&conf, config_name))
{
if (conf->err_msg)
- log(L_ERR "%s, line %d: %s", conf->err_file_name, conf->err_lino, conf->err_msg);
+ log(L_ERR "%s:%d:%d %s", conf->err_file_name, conf->err_lino, conf->err_chno, conf->err_msg);
else
log(L_ERR "Unable to open configuration file %s: %m", config_name);
config_free(conf);
if (!unix_read_config(&conf, name))
{
if (conf->err_msg)
- cli_msg(8002, "%s, line %d: %s", conf->err_file_name, conf->err_lino, conf->err_msg);
+ cli_msg(8002, "%s:%d:%d %s", conf->err_file_name, conf->err_lino, conf->err_chno, conf->err_msg);
else
cli_msg(8002, "%s: %m", name);
config_free(conf);
}
void
-cmd_reconfig(char *name, int type, int timeout)
+cmd_reconfig(char *name, int type, uint timeout)
{
if (cli_access_restricted())
return;
rv = ftruncate(pid_fd, 0);
if (rv < 0)
die("fruncate: %m");
-
+
rv = write(pid_fd, ps, pl);
if(rv < 0)
die("write: %m");
* Parsing of command-line arguments
*/
-static char *opt_list = "c:dD:ps:P:u:g:flRh";
+static char *opt_list = "bc:dD:ps:P:u:g:flRh";
static int parse_and_exit;
char *bird_name;
static char *use_user;
fprintf(stderr,
"\n"
"Options: \n"
- " -c <config-file> Use given configuration file instead\n"
- " of prefix/etc/bird.conf\n"
+ " -c <config-file> Use given configuration file instead of\n"
+ " " PATH_CONFIG_FILE "\n"
" -d Enable debug messages and run bird in foreground\n"
" -D <debug-file> Log debug messages to given file instead of stderr\n"
" -f Run bird in foreground\n"
" -g <group> Use given group ID\n"
" -h, --help Display this information\n"
- " -l Look for a configuration file and a communication socket\n"
- " file in the current working directory\n"
+ " -l Look for a configuration file and a control socket\n"
+ " in the current working directory\n"
" -p Test configuration file and exit without start\n"
" -P <pid-file> Create a PID file with given filename\n"
" -R Apply graceful restart recovery after start\n"
config_changed = 1;
break;
case 'd':
- debug_flag |= 1;
+ log_init_debug("");
+ run_in_foreground = 1;
break;
case 'D':
log_init_debug(optarg);
- debug_flag |= 2;
break;
case 'p':
parse_and_exit = 1;
#endif
parse_args(argc, argv);
- if (debug_flag == 1)
- log_init_debug("");
- log_switch(debug_flag, NULL, NULL);
+ log_switch(1, NULL, NULL);
+ net_init();
resource_init();
+ timer_init();
olock_init();
io_init();
rt_init();
if (parse_and_exit)
exit(0);
- if (!(debug_flag||run_in_foreground))
+ if (!run_in_foreground)
{
pid_t pid = fork();
if (pid < 0)