]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospfd/ospf_main.c
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
[mirror_frr.git] / ospfd / ospf_main.c
index f284a04cbe5498a6ebf204066217252435bfb2ae..36bb8d49b595caefd3c4c3af2fbad29482a7a0c2 100644 (file)
 #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"
+#include "ospfd/ospf_errors.h"
 
 /* ospfd privileges */
-zebra_capabilities_t _caps_p[] = {
-       ZCAP_NET_RAW, ZCAP_BIND, ZCAP_NET_ADMIN,
-};
+zebra_capabilities_t _caps_p[] = {ZCAP_NET_RAW, ZCAP_BIND, ZCAP_NET_ADMIN,
+                                 ZCAP_SYS_ADMIN};
 
 struct zebra_privs_t ospfd_privs = {
 #if defined(FRR_USER) && defined(FRR_GROUP)
@@ -122,18 +123,23 @@ struct quagga_signal_t ospf_signals[] = {
        },
 };
 
+static const struct frr_yang_module_info *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)
 {
-       u_short instance = 0;
+       unsigned short instance = 0;
 
 #ifdef SUPPORT_OSPF_API
        /* OSPF apiserver is disabled by default. */
@@ -186,8 +192,8 @@ int main(int argc, char **argv)
        master = om->master;
 
        /* Library inits. */
-       debug_init();
-       vrf_init(NULL, NULL, NULL, NULL);
+       ospf_debug_init();
+       ospf_vrf_init();
 
        access_list_init();
        prefix_list_init();
@@ -207,12 +213,16 @@ int main(int argc, char **argv)
        ospf_route_map_init();
        ospf_opaque_init();
 
+       /* 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)) {
-               zlog_err("OSPF instance init failed: %s", strerror(errno));
+               flog_err(EC_OSPF_INIT_FAIL, "OSPF instance init failed: %s",
+                        strerror(errno));
                exit(1);
        }