summaryrefslogtreecommitdiff
path: root/zebra/zebra_router.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_router.c')
-rw-r--r--zebra/zebra_router.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c
index 1e9f9e4ec7..e5319c64af 100644
--- a/zebra/zebra_router.c
+++ b/zebra/zebra_router.c
@@ -29,7 +29,7 @@
#include "zebra_pbr.h"
#include "zebra_vxlan.h"
#include "zebra_mlag.h"
-#include "zebra_nhg.h"
+#include "zebra_nhg_private.h"
#include "debug.h"
DEFINE_MTYPE_STATIC(ZEBRA, RIB_TABLE_INFO, "RIB table info")
@@ -154,6 +154,11 @@ void zebra_router_sweep_route(void)
}
}
+void zebra_router_sweep_nhgs(void)
+{
+ zebra_nhg_sweep_table(zrouter.nhgs_id);
+}
+
static void zebra_router_free_table(struct zebra_router_table *zrt)
{
void *table_info;
@@ -218,6 +223,11 @@ void zebra_router_terminate(void)
zebra_vxlan_disable();
zebra_mlag_terminate();
+ hash_clean(zrouter.nhgs, zebra_nhg_free);
+ hash_free(zrouter.nhgs);
+ hash_clean(zrouter.nhgs_id, NULL);
+ hash_free(zrouter.nhgs_id);
+
hash_clean(zrouter.rules_hash, zebra_pbr_rules_free);
hash_free(zrouter.rules_hash);
@@ -253,4 +263,11 @@ void zebra_router_init(void)
zrouter.iptable_hash = hash_create_size(8, zebra_pbr_iptable_hash_key,
zebra_pbr_iptable_hash_equal,
"IPtable Hash Entry");
+
+ zrouter.nhgs =
+ hash_create_size(8, zebra_nhg_hash_key, zebra_nhg_hash_equal,
+ "Zebra Router Nexthop Groups");
+ zrouter.nhgs_id =
+ hash_create_size(8, zebra_nhg_id_key, zebra_nhg_hash_id_equal,
+ "Zebra Router Nexthop Groups ID index");
}