summaryrefslogtreecommitdiffstats
path: root/isisd
diff options
context:
space:
mode:
Diffstat (limited to 'isisd')
-rw-r--r--isisd/Makefile.am1
-rw-r--r--isisd/isis_main.c25
2 files changed, 20 insertions, 6 deletions
diff --git a/isisd/Makefile.am b/isisd/Makefile.am
index 9c303390..a7117fd6 100644
--- a/isisd/Makefile.am
+++ b/isisd/Makefile.am
@@ -2,7 +2,6 @@
INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib \
@ISIS_TOPOLOGY_INCLUDES@
-DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\"
INSTALL_SDATA=@INSTALL@ -m 600
LIBS = @LIBS@
diff --git a/isisd/isis_main.c b/isisd/isis_main.c
index c5e824c1..d457d25e 100644
--- a/isisd/isis_main.c
+++ b/isisd/isis_main.c
@@ -34,6 +34,7 @@
#include "privs.h"
#include "sigevent.h"
#include "filter.h"
+#include "paths.h"
#include "isisd/dict.h"
#include "include-netbsd/iso.h"
@@ -45,7 +46,10 @@
#include "isisd/isis_dynhn.h"
/* Default configuration file name */
-#define ISISD_DEFAULT_CONFIG "isisd.conf"
+#define ISISD_CONFIG_NAME "isisd.conf"
+#define ISISD_PID_NAME "isisd.pid"
+#define ISISD_VTY_NAME "isisd.vty"
+
/* Default vty port */
#define ISISD_VTY_PORT 2608
@@ -73,6 +77,7 @@ struct zebra_privs_t isisd_privs = {
/* isisd options */
struct option longopts[] = {
{"daemon", no_argument, NULL, 'd'},
+ {"namespace", required_argument, NULL, 'N'},
{"config_file", required_argument, NULL, 'f'},
{"pid_file", required_argument, NULL, 'i'},
{"vty_addr", required_argument, NULL, 'A'},
@@ -86,7 +91,7 @@ struct option longopts[] = {
};
/* Configuration file and directory. */
-char config_default[] = SYSCONFDIR ISISD_DEFAULT_CONFIG;
+char config_default[MAXPATHLEN];
char *config_file = NULL;
/* isisd program name. */
@@ -97,8 +102,11 @@ int daemon_mode = 0;
/* Master of threads. */
struct thread_master *master;
+/* pid_file default value */
+static char pid_file_default[MAXPATHLEN];
+
/* Process ID saved for use by init system */
-const char *pid_file = PATH_ISISD_PID;
+const char *pid_file = pid_file_default;
/* for reload */
char _cwd[MAXPATHLEN];
@@ -128,6 +136,7 @@ usage (int status)
printf ("Usage : %s [OPTION...]\n\n\
Daemon which manages IS-IS routing\n\n\
-d, --daemon Runs in daemon mode\n\
+-N, --namespace Insert argument into all paths\n\
-f, --config_file Set configuration file name\n\
-i, --pid_file Set process identifier file name\n\
-A, --vty_addr Set vty's bind address\n\
@@ -246,7 +255,7 @@ main (int argc, char **argv, char **envp)
/* Command line argument treatment. */
while (1)
{
- opt = getopt_long (argc, argv, "df:i:hA:p:P:u:g:vC", longopts, 0);
+ opt = getopt_long (argc, argv, "dN:f:i:hA:p:P:u:g:vC", longopts, 0);
if (opt == EOF)
break;
@@ -258,6 +267,9 @@ main (int argc, char **argv, char **envp)
case 'd':
daemon_mode = 1;
break;
+ case 'N':
+ path_set_namespace (optarg);
+ break;
case 'f':
config_file = optarg;
break;
@@ -303,6 +315,9 @@ main (int argc, char **argv, char **envp)
}
}
+ strcpy (config_default, path_config (ISISD_CONFIG_NAME));
+ strcpy (pid_file_default, path_state (ISISD_PID_NAME));
+
/* thread master */
master = thread_master_create ();
@@ -343,7 +358,7 @@ main (int argc, char **argv, char **envp)
pid_output (pid_file);
/* Make isis vty socket. */
- vty_serv_sock (vty_addr, vty_port, ISIS_VTYSH_PATH);
+ vty_serv_sock (vty_addr, vty_port, path_state (ISISD_VTY_NAME));
/* Print banner. */
zlog_notice ("Quagga-ISISd %s starting: vty@%d", QUAGGA_VERSION, vty_port);