diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-02-02 16:42:51 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-02-02 16:42:51 +0100 |
commit | 1a35e2e56533f75d68ed30bf24b3c131da4ba950 (patch) | |
tree | 068c7730ed7a58d5374d8123d81720597b40bbcd /pimd/pim_main.c | |
parent | Merge pull request #135 from LabNConsulting/working/master/patch-set/misc+vrf (diff) | |
parent | Merge pull request #153 from LabNConsulting/working/2.0/patch-set/rr-part2 (diff) | |
download | frr-1a35e2e56533f75d68ed30bf24b3c131da4ba950.tar.xz frr-1a35e2e56533f75d68ed30bf24b3c131da4ba950.zip |
Merge remote-tracking branch 'origin/stable/2.0'
Diffstat (limited to 'pimd/pim_main.c')
-rw-r--r-- | pimd/pim_main.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/pimd/pim_main.c b/pimd/pim_main.c index 0749d60b0..2e81ac53f 100644 --- a/pimd/pim_main.c +++ b/pimd/pim_main.c @@ -38,6 +38,7 @@ #include "prefix.h" #include "plist.h" #include "vrf.h" +#include "sockopt.h" #include "pimd.h" #include "pim_version.h" @@ -51,18 +52,25 @@ extern struct host host; char config_default[] = SYSCONFDIR PIMD_DEFAULT_CONFIG; +/* pimd options */ +#define OPTION_VTYSOCK 1000 struct option longopts[] = { { "daemon", no_argument, NULL, 'd'}, { "config_file", required_argument, NULL, 'f'}, { "pid_file", required_argument, NULL, 'i'}, + { "socket", required_argument, NULL, 'z'}, { "vty_addr", required_argument, NULL, 'A'}, { "vty_port", required_argument, NULL, 'P'}, + { "vty_socket", required_argument, NULL, OPTION_VTYSOCK}, { "version", no_argument, NULL, 'v'}, { "debug_zclient", no_argument, NULL, 'Z'}, { "help", no_argument, NULL, 'h'}, { 0 } }; +/* VTY Socket prefix */ +char vty_sock_path[MAXPATHLEN] = PIM_VTYSH_PATH; + /* pimd privileges */ zebra_capabilities_t _caps_p [] = { @@ -103,6 +111,7 @@ Daemon which manages PIM.\n\n\ -z, --socket Set path of zebra socket\n\ -A, --vty_addr Set vty's bind address\n\ -P, --vty_port Set vty's port number\n\ + --vty_socket Override vty socket path\n\ -v, --version Print program version\n\ -h, --help Display this help and exit\n\ \n\ @@ -163,6 +172,9 @@ int main(int argc, char** argv, char** envp) { case 'P': vty_port = atoi (optarg); break; + case OPTION_VTYSOCK: + set_socket_path(vty_sock_path, PIM_VTYSH_PATH, optarg, sizeof (vty_sock_path)); + break; case 'v': printf(PIMD_PROGNAME " version %s\n", PIMD_VERSION); print_version(progname); @@ -228,7 +240,7 @@ int main(int argc, char** argv, char** envp) { /* Create pimd VTY socket */ if (vty_port < 0) vty_port = PIMD_VTY_PORT; - vty_serv_sock(vty_addr, vty_port, PIM_VTYSH_PATH); + vty_serv_sock(vty_addr, vty_port, vty_sock_path); zlog_notice("Quagga %s " PIMD_PROGNAME " %s starting, VTY interface at port TCP %d", FRR_VERSION, PIMD_VERSION, vty_port); |