summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_main.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2009-10-14 18:13:29 +0200
committerDavid Lamparter <equinox@diac24.net>2010-02-04 02:53:48 +0100
commitac9ed56d887357049bae1bc901e80b58961d6380 (patch)
treea5cd31094ee55324fe6a57212c03c6f7828673c4 /ospf6d/ospf6_main.c
parentf99eea6053507e6dbd5ad22f4c7ba80c5a981651 (diff)
downloadquagga-ac9ed56d887357049bae1bc901e80b58961d6380.tar.bz2
quagga-ac9ed56d887357049bae1bc901e80b58961d6380.tar.xz
lib: fs namespacing 2/5: use path_state for vty paths
use the path_state helper functions for determining vty socket paths in all quagga daemons. this allows for running multiple daemons if a namespace name is set.
Diffstat (limited to 'ospf6d/ospf6_main.c')
-rw-r--r--ospf6d/ospf6_main.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c
index a7a96a1f..980cf794 100644
--- a/ospf6d/ospf6_main.c
+++ b/ospf6d/ospf6_main.c
@@ -34,11 +34,14 @@
#include "plist.h"
#include "privs.h"
#include "sigevent.h"
+#include "paths.h"
#include "ospf6d.h"
/* Default configuration file name for ospf6d. */
-#define OSPF6_DEFAULT_CONFIG "ospf6d.conf"
+#define OSPF6_CONFIG_NAME "ospf6d.conf"
+#define OSPF6_PID_NAME "ospf6d.pid"
+#define OSPF6_VTY_NAME "ospf6d.vty"
/* Default port values. */
#define OSPF6_VTY_PORT 2606
@@ -83,7 +86,7 @@ struct option longopts[] =
};
/* Configuration file and directory. */
-char config_default[] = SYSCONFDIR OSPF6_DEFAULT_CONFIG;
+char config_default[MAXPATHLEN];
/* ospf6d program name. */
char *progname;
@@ -94,8 +97,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_OSPF6D_PID;
+const char *pid_file = pid_file_default;
/* Help information display. */
static void
@@ -252,6 +258,9 @@ main (int argc, char *argv[], char *envp[])
}
}
+ strcpy (config_default, path_config (OSPF6_CONFIG_NAME));
+ strcpy (pid_file_default, path_state (OSPF6_PID_NAME));
+
/* thread master */
master = thread_master_create ();
@@ -294,7 +303,7 @@ main (int argc, char *argv[], char *envp[])
/* Make ospf6 vty socket. */
if (!vty_port)
vty_port = OSPF6_VTY_PORT;
- vty_serv_sock (vty_addr, vty_port, OSPF6_VTYSH_PATH);
+ vty_serv_sock (vty_addr, vty_port, path_state (OSPF6_VTY_NAME));
/* Print start message */
zlog_notice ("OSPF6d (Quagga-%s ospf6d-%s) starts: vty@%d",