From 7f0ea8a4a23f4500421e89268b442cf145d0d75f Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 27 Aug 2018 14:36:46 -0400 Subject: zebra: Move rules_hash to zrouter Move the rules_hash to the zrouter data structure and provide the additional bit of work needed to lookup the rule based upon the namespace id as well. Make the callers of functions not care about what namespace id we are in. Signed-off-by: Donald Sharp Signed-off-by: Donald Sharp --- zebra/zebra_router.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'zebra/zebra_router.c') diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c index 1116848a89..94d7ab1b8c 100644 --- a/zebra/zebra_router.c +++ b/zebra/zebra_router.c @@ -23,6 +23,7 @@ #include "zebra_router.h" #include "zebra_memory.h" +#include "zebra_pbr.h" struct zebra_router zrouter; @@ -154,9 +155,16 @@ void zebra_router_terminate(void) RB_REMOVE(zebra_router_table_head, &zrouter.tables, zrt); zebra_router_free_table(zrt); } + + hash_clean(zrouter.rules_hash, zebra_pbr_rules_free); + hash_free(zrouter.rules_hash); } void zebra_router_init(void) { zrouter.l3vni_table = NULL; + + zrouter.rules_hash = hash_create_size(8, zebra_pbr_rules_hash_key, + zebra_pbr_rules_hash_equal, + "Rules Hash"); } -- cgit v1.2.3