]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospfd/ospf_main.c
Merge pull request #5549 from donaldsharp/automated
[mirror_frr.git] / ospfd / ospf_main.c
index 6dadc05bbab42bcaa95d84d3ae5479ba3f3a2df8..d02ffe0448df73ad394fd1e04c67218729d2b850 100644 (file)
@@ -35,7 +35,6 @@
 #include "stream.h"
 #include "log.h"
 #include "memory.h"
-#include "memory_vty.h"
 #include "privs.h"
 #include "sigevent.h"
 #include "zclient.h"
@@ -49,6 +48,7 @@
 #include "ospfd/ospf_lsdb.h"
 #include "ospfd/ospf_neighbor.h"
 #include "ospfd/ospf_dump.h"
+#include "ospfd/ospf_route.h"
 #include "ospfd/ospf_zebra.h"
 #include "ospfd/ospf_vty.h"
 #include "ospfd/ospf_bfd.h"
@@ -71,9 +71,11 @@ struct zebra_privs_t ospfd_privs = {
        .cap_num_i = 0};
 
 /* OSPFd options. */
-struct option longopts[] = {{"instance", required_argument, NULL, 'n'},
-                           {"apiserver", no_argument, NULL, 'a'},
-                           {0}};
+const struct option longopts[] = {
+       {"instance", required_argument, NULL, 'n'},
+       {"apiserver", no_argument, NULL, 'a'},
+       {0}
+};
 
 /* OSPFd program name */
 
@@ -122,13 +124,18 @@ struct quagga_signal_t ospf_signals[] = {
        },
 };
 
+static const struct frr_yang_module_info *const ospfd_yang_modules[] = {
+       &frr_interface_info,
+};
+
 FRR_DAEMON_INFO(ospfd, OSPF, .vty_port = OSPF_VTY_PORT,
 
                .proghelp = "Implementation of the OSPFv2 routing protocol.",
 
                .signals = ospf_signals, .n_signals = array_size(ospf_signals),
 
-               .privs = &ospfd_privs, )
+               .privs = &ospfd_privs, .yang_modules = ospfd_yang_modules,
+               .n_yang_modules = array_size(ospfd_yang_modules), )
 
 /* OSPFd main routine. */
 int main(int argc, char **argv)
@@ -186,7 +193,7 @@ int main(int argc, char **argv)
        master = om->master;
 
        /* Library inits. */
-       debug_init();
+       ospf_debug_init();
        ospf_vrf_init();
 
        access_list_init();
@@ -210,16 +217,6 @@ int main(int argc, char **argv)
        /* OSPF errors init */
        ospf_error_init();
 
-       /* Need to initialize the default ospf structure, so the interface mode
-          commands can be duly processed if they are received before 'router
-          ospf',
-          when quagga(ospfd) is restarted */
-       if (!ospf_get_instance(instance)) {
-               flog_err(OSPF_ERR_INIT_FAIL, "OSPF instance init failed: %s",
-                         strerror(errno));
-               exit(1);
-       }
-
        frr_config_fork();
        frr_run(master);