summaryrefslogtreecommitdiff
path: root/ospfd
diff options
context:
space:
mode:
authorhasso <hasso>2004-10-11 16:27:03 +0000
committerhasso <hasso>2004-10-11 16:27:03 +0000
commitc3abdb722d35eb93ca72078a7da1b4661accab27 (patch)
treeb89076220a74f3ca9c5e408331d4f2206bbdaed1 /ospfd
parente2ea9fef99392299d6291067522eef0d99e1714c (diff)
Disable ospfapi init by default.
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ChangeLog5
-rw-r--r--ospfd/ospf_main.c16
-rw-r--r--ospfd/ospf_opaque.c3
3 files changed, 19 insertions, 5 deletions
diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog
index 75e3b4db..86cbe592 100644
--- a/ospfd/ChangeLog
+++ b/ospfd/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-11 Hasso Tepper <hasso at quagga.net>
+
+ * ospf_main.c, ospf_opaque.c: Disable ospfapi init by default. New
+ command line switch to enable it.
+
2004-10-11 Paul Jakma <paul@dishone.st>
* ospf_dump.c: (ospf_ip_header_dump) Assume header is in host order
diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c
index 47873ba8..a7e56dcd 100644
--- a/ospfd/ospf_main.c
+++ b/ospfd/ospf_main.c
@@ -87,6 +87,7 @@ struct option longopts[] =
{ "vty_addr", required_argument, NULL, 'A'},
{ "vty_port", required_argument, NULL, 'P'},
{ "user", required_argument, NULL, 'u'},
+ { "apiserver", no_argument, NULL, 'a'},
{ "version", no_argument, NULL, 'v'},
{ 0 }
};
@@ -99,6 +100,9 @@ struct thread_master *master;
/* Process ID saved for use by init system */
const char *pid_file = PATH_OSPFD_PID;
+/* OSPF apiserver is disabled by default. */
+int ospf_apiserver_enable = 0;
+
/* Help information display. */
static void
usage (char *progname, int status)
@@ -115,6 +119,7 @@ Daemon which manages OSPF.\n\n\
-A, --vty_addr Set vty's bind address\n\
-P, --vty_port Set vty's port number\n\
-u, --user User and group to run as\n\
+-a. --apiserver Enable OSPF apiserver\n\
-v, --version Print program version\n\
-h, --help Display this help and exit\n\
\n\
@@ -204,7 +209,7 @@ main (int argc, char **argv)
{
int opt;
- opt = getopt_long (argc, argv, "dlf:i:hA:P:u:v", longopts, 0);
+ opt = getopt_long (argc, argv, "dlf:i:hA:P:u:av", longopts, 0);
if (opt == EOF)
break;
@@ -236,9 +241,12 @@ main (int argc, char **argv)
vty_port = atoi (optarg);
vty_port = (vty_port ? vty_port : OSPF_VTY_PORT);
break;
- case 'u':
- ospfd_privs.group = ospfd_privs.user = optarg;
- break;
+ case 'u':
+ ospfd_privs.group = ospfd_privs.user = optarg;
+ break;
+ case 'a':
+ ospf_apiserver_enable = 1;
+ break;
case 'v':
print_version (progname);
exit (0);
diff --git a/ospfd/ospf_opaque.c b/ospfd/ospf_opaque.c
index 414ec743..d0d1be3d 100644
--- a/ospfd/ospf_opaque.c
+++ b/ospfd/ospf_opaque.c
@@ -69,6 +69,7 @@
#ifdef SUPPORT_OSPF_API
int ospf_apiserver_init (void);
void ospf_apiserver_term (void);
+extern int ospf_apiserver_enable;
#endif /* SUPPORT_OSPF_API */
static void ospf_opaque_register_vty (void);
@@ -91,7 +92,7 @@ ospf_opaque_init (void)
#endif /* HAVE_OSPF_TE */
#ifdef SUPPORT_OSPF_API
- if (ospf_apiserver_init () != 0)
+ if ((ospf_apiserver_enable) && (ospf_apiserver_init () != 0))
exit (1);
#endif /* SUPPORT_OSPF_API */