main (int argc, char **argv)
{
int opt;
- struct thread thread;
int tmp_port;
int bgp_port = BGP_PORT_DEFAULT;
/* BGP related initialization. */
bgp_init ();
- frr_config_fork ();
-
- /* Make bgp vty socket. */
- frr_vty_serv ();
+ snprintf (bgpd_di.startinfo, sizeof (bgpd_di.startinfo), ", bgp@%s:%d",
+ (bm->address ? bm->address : "<all>"),
+ bm->port);
- /* Print banner. */
- zlog_notice ("BGPd %s starting: vty@%d, bgp@%s:%d", FRR_VERSION,
- bgpd_di.vty_port,
- (bm->address ? bm->address : "<all>"),
- bm->port);
-
- /* Start finite state machine, here we go! */
- while (thread_fetch (bm->master, &thread))
- thread_call (&thread);
+ frr_config_fork ();
+ frr_run (bm->master);
/* Not reached. */
return (0);
main (int argc, char **argv, char **envp)
{
int opt;
- struct thread thread;
/* for reload */
_argc = argc;
isis_zebra_init(master);
frr_config_fork ();
-
- /* Make isis vty socket. */
- frr_vty_serv ();
-
- /* Print banner. */
- zlog_notice ("Quagga-ISISd %s starting: vty@%d", FRR_VERSION, isisd_di.vty_port);
-
- /* Start finite state machine. */
- while (thread_fetch (master, &thread))
- thread_call (&thread);
+ frr_run (master);
/* Not reached. */
exit (0);
char *ctl_sock_name;
const char *user = NULL;
const char *group = NULL;
- struct thread thread;
ldpd_process = PROC_MAIN;
if (ldpd_conf->ipv6.flags & F_LDPD_AF_ENABLED)
main_imsg_send_net_sockets(AF_INET6);
- /* Create VTY socket */
- frr_vty_serv();
-
- /* Print banner. */
- log_notice("LDPd %s starting: vty@%d", FRR_VERSION, ldpd_di.vty_port);
-
- /* Fetch next active thread. */
- while (thread_fetch(master, &thread))
- thread_call(&thread);
+ frr_run(master);
/* NOTREACHED */
return (0);
vty_serv_sock(di->vty_addr, di->vty_port, di->vty_path);
}
+void frr_run(struct thread_master *master)
+{
+ char instanceinfo[64] = "";
+
+ frr_vty_serv();
+
+ if (di->instance)
+ snprintf(instanceinfo, sizeof(instanceinfo), "instance %u ",
+ di->instance);
+
+ zlog_notice("%s %s starting: %svty@%d%s",
+ di->name,
+ FRR_VERSION,
+ instanceinfo,
+ di->vty_port,
+ di->startinfo);
+
+ struct thread thread;
+ while (thread_fetch(master, &thread))
+ thread_call(&thread);
+}
const char *proghelp;
void (*printhelp)(FILE *target);
const char *copyright;
+ char startinfo[128];
struct quagga_signal_t *signals;
size_t n_signals;
extern void frr_vty_serv(void);
+/* note: contains call to frr_vty_serv() */
+extern void frr_run(struct thread_master *master);
+
extern char config_default[256];
extern const char frr_sysconfdir[];
extern const char frr_vtydir[];
int main(int argc, char **argv)
{
- struct thread thread;
-
frr_preinit(&nhrpd_di, argc, argv);
frr_opt_add("", longopts, "");
nhrp_config_init();
frr_config_fork();
-
- /* Create VTY socket */
- frr_vty_serv();
- zlog_notice("nhrpd starting: vty@%d", nhrpd_di.vty_port);
-
- /* Main loop */
- while (thread_fetch(master, &thread))
- thread_call(&thread);
-
+ frr_run(master);
return 0;
}
main (int argc, char *argv[], char *envp[])
{
int opt;
- struct thread thread;
frr_preinit (&ospf6d_di, argc, argv);
frr_opt_add ("", longopts, "");
ospf6_init ();
frr_config_fork ();
-
- frr_vty_serv ();
-
- /* Print start message */
- zlog_notice ("OSPF6d (Quagga-%s ospf6d-%s) starts: vty@%d",
- FRR_VERSION, OSPF6_DAEMON_VERSION, ospf6d_di.vty_port);
-
- /* Start finite state machine, here we go! */
- while (thread_fetch (master, &thread))
- thread_call (&thread);
-
- /* Log in case thread failed */
- zlog_warn ("Thread failed");
+ frr_run (master);
/* Not reached. */
ospf6_exit (0);
main (int argc, char **argv)
{
u_short instance = 0;
- struct thread thread;
#ifdef SUPPORT_OSPF_API
/* OSPF apiserver is disabled by default. */
exit (1);
}
- frr_vty_serv ();
-
- /* Print banner. */
- zlog_notice ("OSPFd %s starting: vty@%d, %s", FRR_VERSION,
- ospfd_di.vty_port, ospfd_di.vty_path);
-
- /* Fetch next active thread. */
- while (thread_fetch (master, &thread))
- thread_call (&thread);
+ frr_config_fork();
+ frr_run (master);
/* Not reached. */
return (0);
)
int main(int argc, char** argv, char** envp) {
- struct thread thread;
-
frr_preinit(&pimd_di, argc, argv);
frr_opt_add("", longopts, "");
frr_config_fork();
- frr_vty_serv();
-
- zlog_notice("Quagga %s " PIMD_PROGNAME " %s starting, VTY interface at port TCP %d",
- FRR_VERSION, PIMD_VERSION, pimd_di.vty_port);
-
#ifdef PIM_DEBUG_BYDEFAULT
zlog_notice("PIM_DEBUG_BYDEFAULT: Enabling all debug commands");
PIM_DO_DEBUG_PIM_EVENTS;
zlog_notice("PIM_UNEXPECTED_KERNEL_UPCALL: report unexpected kernel upcall");
#endif
- while (thread_fetch(master, &thread))
- thread_call(&thread);
-
- zlog_err("%s %s: thread_fetch() returned NULL, exiting",
- __FILE__, __PRETTY_FUNCTION__);
+ frr_run(master);
/* never reached */
return 0;
int
main (int argc, char **argv)
{
- struct thread thread;
-
frr_preinit (&ripd_di, argc, argv);
frr_opt_add ("r", longopts,
" -r, --retain When program terminates, retain added route by ripd.\n");
rip_peer_init ();
frr_config_fork ();
-
- /* Create VTY's socket */
- frr_vty_serv ();
-
- /* Print banner. */
- zlog_notice ("RIPd %s starting: vty@%d", FRR_VERSION, ripd_di.vty_port);
-
- /* Execute each thread. */
- while (thread_fetch (master, &thread))
- thread_call (&thread);
+ frr_run (master);
/* Not reached. */
return (0);
int
main (int argc, char **argv)
{
- struct thread thread;
-
frr_preinit (&ripngd_di, argc, argv);
frr_opt_add ("r", longopts,
" -r, --retain When program terminates, retain added route by ripd.\n");
ripng_peer_init ();
frr_config_fork ();
-
- /* Create VTY socket */
- frr_vty_serv ();
-
- /* Print banner. */
- zlog_notice ("RIPNGd %s starting: vty@%d", FRR_VERSION, ripngd_di.vty_port);
-
- /* Fetch next active thread. */
- while (thread_fetch (master, &thread))
- thread_call (&thread);
+ frr_run (master);
/* Not reached. */
return 0;
main (int argc, char **argv)
{
// int batch_mode = 0;
- struct thread thread;
char *zserv_path = NULL;
char *fpm_format = NULL;
/* This must be done only after locking pidfile (bug #403). */
zebra_zserv_socket_init (zserv_path);
- frr_vty_serv ();
-
- /* Print banner. */
- zlog_notice ("Zebra %s starting: vty@%d", FRR_VERSION, zebra_di.vty_port);
-
- while (thread_fetch (zebrad.master, &thread))
- thread_call (&thread);
+ frr_run (zebrad.master);
/* Not reached... */
return 0;