#include "zebra/router-id.h"
#include "zebra/irdp.h"
#include "zebra/rtadv.h"
+#include "zebra/zebra_fpm.h"
/* Zebra instance */
struct zebra_t zebrad =
#ifdef HAVE_NETLINK
/* Receive buffer size for netlink socket */
-u_int32_t nl_rcvbufsize = 0;
+u_int32_t nl_rcvbufsize = 4194304;
#endif /* HAVE_NETLINK */
/* Command line options. */
{ "keep_kernel", no_argument, NULL, 'k'},
{ "config_file", required_argument, NULL, 'f'},
{ "pid_file", required_argument, NULL, 'i'},
+ { "socket", required_argument, NULL, 'z'},
{ "help", no_argument, NULL, 'h'},
{ "vty_addr", required_argument, NULL, 'A'},
{ "vty_port", required_argument, NULL, 'P'},
.vty_group = VTY_GROUP,
#endif
.caps_p = _caps_p,
- .cap_num_p = sizeof(_caps_p)/sizeof(_caps_p[0]),
+ .cap_num_p = array_size(_caps_p),
.cap_num_i = 0
};
"-d, --daemon Runs in daemon mode\n"\
"-f, --config_file Set configuration file name\n"\
"-i, --pid_file Set process identifier file name\n"\
+ "-z, --socket Set path of zebra socket\n"\
"-k, --keep_kernel Don't delete old routes which installed by "\
"zebra.\n"\
"-C, --dryrun Check configuration for validity and exit\n"\
exit (status);
}
-\f
+
/* SIGHUP handler. */
static void
sighup (void)
.handler = &sigint,
},
};
-\f
+
/* Main startup routine. */
int
main (int argc, char **argv)
char *config_file = NULL;
char *progname;
struct thread thread;
+ char *zserv_path = NULL;
/* Set umask before anything for security */
umask (0027);
int opt;
#ifdef HAVE_NETLINK
- opt = getopt_long (argc, argv, "bdkf:i:hA:P:ru:g:vs:C", longopts, 0);
+ opt = getopt_long (argc, argv, "bdkf:i:z:hA:P:ru:g:vs:C", longopts, 0);
#else
- opt = getopt_long (argc, argv, "bdkf:i:hA:P:ru:g:vC", longopts, 0);
+ opt = getopt_long (argc, argv, "bdkf:i:z:hA:P:ru:g:vC", longopts, 0);
#endif /* HAVE_NETLINK */
if (opt == EOF)
case 'i':
pid_file = optarg;
break;
+ case 'z':
+ zserv_path = optarg;
+ break;
case 'P':
/* Deal with atoi() returning 0 on failure, and zebra not
listening on zebra port... */
zprivs_init (&zserv_privs);
/* Vty related initialize. */
- signal_init (zebrad.master, Q_SIGC(zebra_signals), zebra_signals);
+ signal_init (zebrad.master, array_size(zebra_signals), zebra_signals);
cmd_init (1);
vty_init (zebrad.master);
memory_init ();
zebra_vty_init ();
access_list_init ();
prefix_list_init ();
+#ifdef RTADV
rtadv_init ();
+#endif
#ifdef HAVE_IRDP
irdp_init();
#endif
interface_list ();
route_read ();
- /* Sort VTY commands. */
- sort_node ();
-
#ifdef HAVE_SNMP
zebra_snmp_init ();
#endif /* HAVE_SNMP */
+#ifdef HAVE_FPM
+ zfpm_init (zebrad.master, 1, 0);
+#else
+ zfpm_init (zebrad.master, 0, 0);
+#endif
+
/* Process the configuration file. Among other configuration
* directives we can meet those installing static routes. Such
* requests will not be executed immediately, but queued in
exit (0);
/* Daemonize. */
- if (daemon_mode)
- daemon (0, 0);
+ if (daemon_mode && daemon (0, 0) < 0)
+ {
+ zlog_err("Zebra daemon failed: %s", strerror(errno));
+ exit (1);
+ }
/* Output pid of zebra. */
pid_output (pid_file);
pid = getpid ();
/* This must be done only after locking pidfile (bug #403). */
- zebra_zserv_socket_init ();
+ zebra_zserv_socket_init (zserv_path);
/* Make vty server socket. */
vty_serv_sock (vty_addr, vty_port, ZEBRA_VTYSH_PATH);