]> git.proxmox.com Git - mirror_frr.git/blobdiff - staticd/static_main.c
lib: enforce vrf_name_to_id by returning default_vrf when name is null
[mirror_frr.git] / staticd / static_main.c
index 7da526cefd491fb88e0dc6f557cd2c1aff5aa114..77243994e2078bf2dd42dea755f620614b8623b3 100644 (file)
@@ -3,15 +3,15 @@
  * Copyright (C) 2018 Cumulus Networks, Inc.
  *               Donald Sharp
  *
- * FRR is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
  *
- * FRR is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
  *
  * You should have received a copy of the GNU General Public License along
  * with this program; see the file COPYING; if not, write to the Free Software
 #include "libfrr.h"
 #include "vrf.h"
 #include "nexthop.h"
+#include "filter.h"
 
 #include "static_vrf.h"
 #include "static_vty.h"
 #include "static_routes.h"
 #include "static_zebra.h"
 
+char backup_config_file[256];
+
 bool mpls_enabled;
 
 zebra_capabilities_t _caps_p[] = {
@@ -97,6 +100,9 @@ struct quagga_signal_t static_signals[] = {
        },
 };
 
+static const struct frr_yang_module_info *staticd_yang_modules[] = {
+};
+
 #define STATIC_VTY_PORT 2616
 
 FRR_DAEMON_INFO(staticd, STATIC, .vty_port = STATIC_VTY_PORT,
@@ -106,7 +112,9 @@ FRR_DAEMON_INFO(staticd, STATIC, .vty_port = STATIC_VTY_PORT,
                .signals = static_signals,
                .n_signals = array_size(static_signals),
 
-               .privs = &static_privs, )
+               .privs = &static_privs, .yang_modules = staticd_yang_modules,
+               .n_yang_modules = array_size(staticd_yang_modules),
+)
 
 int main(int argc, char **argv, char **envp)
 {
@@ -132,11 +140,16 @@ int main(int argc, char **argv, char **envp)
 
        master = frr_init();
 
+       access_list_init();
        static_vrf_init();
 
        static_zebra_init();
        static_vty_init();
 
+       snprintf(backup_config_file, sizeof(backup_config_file),
+                "%s/zebra.conf", frr_sysconfdir);
+       staticd_di.backup_config_file = backup_config_file;
+
        frr_config_fork();
        frr_run(master);