int protocol_socket = -1; /* socket: communicate with others babeld */
static char babel_config_default[] = SYSCONFDIR BABEL_DEFAULT_CONFIG;
-static char *babel_config_file = NULL;
static char *babel_vty_addr = NULL;
static int babel_vty_port = BABEL_VTY_PORT;
ZCAP_BIND
};
-static struct zebra_privs_t babeld_privs =
+struct zebra_privs_t babeld_privs =
{
#if defined(FRR_USER)
.user = FRR_USER,
/* this replace kernel_setup && kernel_setup_socket */
babelz_zebra_init ();
- /* Get zebra configuration file. */
- vty_read_config (babel_config_file, babel_config_default);
-
/* init buffer */
rc = resize_receive_buffer(1500);
if(rc < 0)
schedule_neighbours_check(5000, 1);
- zlog_notice ("BABELd %s starting: vty@%d", BABEL_VERSION, babel_vty_port);
-
frr_config_fork();
frr_run(master);
if(fd >= 0 && rc < 0) {
zlog_err("unlink(babel-state): %s", safe_strerror(errno));
/* If we couldn't unlink it, it's probably stale. */
- close(fd);
- fd = -1;
+ goto fini;
}
if(fd >= 0) {
char buf[100];
zlog_err("Couldn't parse babel-state.");
}
}
- close(fd);
- fd = -1;
+ goto fini;
}
+fini:
+ if (fd >= 0)
+ close(fd);
+ return ;
}
static void
babel_save_state_file();
debugf(BABEL_DEBUG_COMMON, "Remove pid file.");
debugf(BABEL_DEBUG_COMMON, "Done.");
+ frr_fini();
exit(0);
}
void
show_babel_main_configuration (struct vty *vty)
{
- vty_out(vty,
- "state file = %s%s"
- "configuration file = %s%s"
- "protocol informations:%s"
- " multicast address = %s%s"
- " port = %d%s"
- "vty address = %s%s"
- "vty port = %d%s"
- "id = %s%s"
- "kernel_metric = %d%s",
- state_file, VTY_NEWLINE,
- babel_config_file ? babel_config_file : babel_config_default,
- VTY_NEWLINE,
- VTY_NEWLINE,
- format_address(protocol_group), VTY_NEWLINE,
- protocol_port, VTY_NEWLINE,
+ vty_out (vty,
+ "state file = %s\n"
+ "configuration file = %s\n"
+ "protocol informations:\n"
+ " multicast address = %s\n"
+ " port = %d\n"
+ "vty address = %s\n"
+ "vty port = %d\n"
+ "id = %s\n"
+ "kernel_metric = %d\n",
+ state_file,
+ babeld_di.config_file ? babeld_di.config_file : babel_config_default,
+ format_address(protocol_group),
+ protocol_port,
babel_vty_addr ? babel_vty_addr : "None",
- VTY_NEWLINE,
- babel_vty_port, VTY_NEWLINE,
- format_eui64(myid), VTY_NEWLINE,
- kernel_metric, VTY_NEWLINE);
+ babel_vty_port,
+ format_eui64(myid),
+ kernel_metric);
}