]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/main.c
*: Rename thread.[ch] to event.[ch]
[mirror_frr.git] / zebra / main.c
index e516688a1955a54f766f090f4c9f193bd45d079c..49b928d09cb6b430aaeed8879aa6575c16045d7e 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* zebra daemon main routine.
  * Copyright (C) 1997, 98 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra 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.
- *
- * GNU Zebra 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
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -23,7 +8,7 @@
 #include <lib/version.h>
 #include "getopt.h"
 #include "command.h"
-#include "thread.h"
+#include "event.h"
 #include "filter.h"
 #include "memory.h"
 #include "prefix.h"
@@ -33,6 +18,7 @@
 #include "sigevent.h"
 #include "vrf.h"
 #include "libfrr.h"
+#include "affinitymap.h"
 #include "routemap.h"
 #include "routing_nb.h"
 
@@ -71,9 +57,6 @@ struct thread_master *master;
 /* Route retain mode flag. */
 int retain_mode = 0;
 
-/* Allow non-frr entities to delete frr routes */
-int allow_delete = 0;
-
 int graceful_restart;
 
 bool v6_rr_semantics = false;
@@ -224,14 +207,15 @@ void zebra_finalize(struct thread *dummy)
 {
        zlog_info("Zebra final shutdown");
 
-       /* Final shutdown of ns resources */
-       ns_walk_func(zebra_ns_final_shutdown, NULL, NULL);
-
        /* Stop dplane thread and finish any cleanup */
        zebra_dplane_shutdown();
 
+       /* Final shutdown of ns resources */
+       ns_walk_func(zebra_ns_final_shutdown, NULL, NULL);
+
        zebra_router_terminate();
 
+       ns_terminate();
        frr_fini();
        exit(0);
 }
@@ -261,6 +245,7 @@ struct frr_signal_t zebra_signals[] = {
        },
 };
 
+/* clang-format off */
 static const struct frr_yang_module_info *const zebra_yang_modules[] = {
        &frr_filter_info,
        &frr_interface_info,
@@ -268,8 +253,10 @@ static const struct frr_yang_module_info *const zebra_yang_modules[] = {
        &frr_zebra_info,
        &frr_vrf_info,
        &frr_routing_info,
+       &frr_affinity_map_info,
        &frr_zebra_route_map_info,
 };
+/* clang-format on */
 
 FRR_DAEMON_INFO(
        zebra, ZEBRA, .vty_port = ZEBRA_VTY_PORT, .flags = FRR_NO_ZCLIENT,
@@ -336,7 +323,7 @@ int main(int argc, char **argv)
                        // batch_mode = 1;
                        break;
                case 'a':
-                       allow_delete = 1;
+                       zrouter.allow_delete = true;
                        break;
                case 'e': {
                        unsigned long int parsed_multipath =