diff options
-rw-r--r-- | bgpd/bgp_nexthop.c | 3 | ||||
-rwxr-xr-x | configure.ac | 1 | ||||
-rw-r--r-- | lib/zclient.c | 3 | ||||
-rw-r--r-- | lib/zclient.h | 3 | ||||
-rw-r--r-- | ospfd/ospf_main.c | 8 | ||||
-rw-r--r-- | vtysh/vtysh_main.c | 4 | ||||
-rw-r--r-- | zebra/zserv.c | 3 |
7 files changed, 18 insertions, 7 deletions
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c index 0cde665e..ba6f6ffa 100644 --- a/bgpd/bgp_nexthop.c +++ b/bgpd/bgp_nexthop.c @@ -28,6 +28,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #include "network.h" #include "log.h" #include "memory.h" +#include "paths.h" #include "bgpd/bgpd.h" #include "bgpd/bgp_table.h" @@ -1097,7 +1098,7 @@ zlookup_connect (struct thread *t) #ifdef HAVE_TCP_ZEBRA zlookup->sock = zclient_socket (); #else - zlookup->sock = zclient_socket_un (ZEBRA_SERV_PATH); + zlookup->sock = zclient_socket_un (path_state (ZEBRA_SERV_NAME)); #endif /* HAVE_TCP_ZEBRA */ if (zlookup->sock < 0) return -1; diff --git a/configure.ac b/configure.ac index 1b60a93a..0d2ad980 100755 --- a/configure.ac +++ b/configure.ac @@ -1494,7 +1494,6 @@ AC_SUBST(quagga_statedir) AC_DEFINE_UNQUOTED(PATH_STATE, "$quagga_statedir",zebra state path) AC_DEFINE_UNQUOTED(PATH_WATCHQUAGGA_PID, "$quagga_statedir/watchquagga.pid",watchquagga PID) -AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket) AC_DEFINE_UNQUOTED(DAEMON_VTY_DIR, "$quagga_statedir",daemon vty directory) dnl ------------------------------- diff --git a/lib/zclient.c b/lib/zclient.c index d3d53227..0d531ce7 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -32,6 +32,7 @@ #include "zclient.h" #include "memory.h" #include "table.h" +#include "paths.h" /* Zebra client events. */ enum event {ZCLIENT_SCHEDULE, ZCLIENT_READ, ZCLIENT_CONNECT}; @@ -317,7 +318,7 @@ zclient_start (struct zclient *zclient) #ifdef HAVE_TCP_ZEBRA zclient->sock = zclient_socket (); #else - zclient->sock = zclient_socket_un (ZEBRA_SERV_PATH); + zclient->sock = zclient_socket_un (path_state (ZEBRA_SERV_NAME)); #endif /* HAVE_TCP_ZEBRA */ if (zclient->sock < 0) { diff --git a/lib/zclient.h b/lib/zclient.h index 21786ab8..6a63ffa4 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -28,6 +28,9 @@ /* For input/output buffer to zebra. */ #define ZEBRA_MAX_PACKET_SIZ 4096 +/* Name of the zebra API socket */ +#define ZEBRA_SERV_NAME "zserv.api" + /* Zebra header size. */ #define ZEBRA_HEADER_SIZE 6 diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c index 30993aa3..0e9e182a 100644 --- a/ospfd/ospf_main.c +++ b/ospfd/ospf_main.c @@ -38,6 +38,7 @@ #include "memory.h" #include "privs.h" #include "sigevent.h" +#include "paths.h" #include "ospfd/ospfd.h" #include "ospfd/ospf_interface.h" @@ -78,6 +79,7 @@ char config_default[MAXPATHLEN]; 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'}, { "dryrun", no_argument, NULL, 'C'}, @@ -117,6 +119,7 @@ usage (char *progname, int status) printf ("Usage : %s [OPTION...]\n\ Daemon which manages OSPF.\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\ @@ -217,7 +220,7 @@ main (int argc, char **argv) { int opt; - opt = getopt_long (argc, argv, "df:i:hA:P:u:g:avC", longopts, 0); + opt = getopt_long (argc, argv, "dN:f:i:hA:P:u:g:avC", longopts, 0); if (opt == EOF) break; @@ -229,6 +232,9 @@ main (int argc, char **argv) case 'd': daemon_mode = 1; break; + case 'N': + path_set_namespace (optarg); + break; case 'f': config_file = optarg; break; diff --git a/vtysh/vtysh_main.c b/vtysh/vtysh_main.c index 4a315a5c..d8987a26 100644 --- a/vtysh/vtysh_main.c +++ b/vtysh/vtysh_main.c @@ -33,6 +33,7 @@ #include "getopt.h" #include "command.h" #include "memory.h" +#include "paths.h" #include "vtysh/vtysh.h" #include "vtysh/vtysh_user.h" @@ -41,7 +42,6 @@ char *progname; /* Configuration file name and directory. */ -char config_default[] = SYSCONFDIR VTYSH_DEFAULT_CONFIG; char history_file[MAXPATHLEN]; /* Flag for indicate executing child command. */ @@ -302,7 +302,7 @@ main (int argc, char **argv, char **env) sort_node (); /* Read vtysh configuration file before connecting to daemons. */ - vtysh_read_config (config_default); + vtysh_read_config (path_config (VTYSH_DEFAULT_CONFIG)); /* Start execution only if not in dry-run mode */ if(dryrun) diff --git a/zebra/zserv.c b/zebra/zserv.c index cb5e411c..e3e15a01 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -36,6 +36,7 @@ #include "privs.h" #include "network.h" #include "buffer.h" +#include "paths.h" #include "zebra/zserv.h" #include "zebra/router-id.h" @@ -1738,6 +1739,6 @@ zebra_zserv_socket_init (void) #ifdef HAVE_TCP_ZEBRA zebra_serv (); #else - zebra_serv_un (ZEBRA_SERV_PATH); + zebra_serv_un (path_state (ZEBRA_SERV_NAME)); #endif /* HAVE_TCP_ZEBRA */ } |