summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_router.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_router.c')
-rw-r--r--zebra/zebra_router.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c
index 4caaf8a..3fd4e6e 100644
--- a/zebra/zebra_router.c
+++ b/zebra/zebra_router.c
@@ -70,6 +70,26 @@ struct zebra_router_table *zebra_router_find_zrt(struct zebra_vrf *zvrf,
return zrt;
}
+struct zebra_router_table *zebra_router_find_next_zrt(struct zebra_vrf *zvrf,
+ uint32_t tableid,
+ afi_t afi, safi_t safi)
+{
+ struct zebra_router_table finder;
+ struct zebra_router_table *zrt;
+
+ memset(&finder, 0, sizeof(finder));
+ finder.afi = afi;
+ finder.safi = safi;
+ finder.tableid = tableid;
+ finder.ns_id = zvrf->zns->ns_id;
+ zrt = RB_NFIND(zebra_router_table_head, &zrouter.tables, &finder);
+ if (zrt->afi == afi && zrt->safi == safi && zrt->tableid == tableid &&
+ zrt->ns_id == finder.ns_id)
+ zrt = RB_NEXT(zebra_router_table_head, zrt);
+
+ return zrt;
+}
+
struct route_table *zebra_router_find_table(struct zebra_vrf *zvrf,
uint32_t tableid, afi_t afi,
safi_t safi)
@@ -241,11 +261,15 @@ void zebra_router_terminate(void)
zebra_pbr_ipset_entry_free);
hash_clean_and_free(&zrouter.ipset_hash, zebra_pbr_ipset_free);
hash_clean_and_free(&zrouter.iptable_hash, zebra_pbr_iptable_free);
+ hash_clean_and_free(&zrouter.filter_hash, (void (*)(void *)) zebra_tc_filter_free);
+ hash_clean_and_free(&zrouter.qdisc_hash, (void (*)(void *)) zebra_tc_qdisc_free);
+ hash_clean_and_free(&zrouter.class_hash, (void (*)(void *)) zebra_tc_class_free);
#ifdef HAVE_SCRIPTING
zebra_script_destroy();
#endif
+ zebra_vxlan_terminate();
/* OS-specific deinit */
kernel_router_terminate();
}
@@ -295,10 +319,6 @@ void zebra_router_init(bool asic_offload, bool notify_on_ack,
hash_create_size(8, zebra_nhg_id_key, zebra_nhg_hash_id_equal,
"Zebra Router Nexthop Groups ID index");
- zrouter.rules_hash =
- hash_create_size(8, zebra_pbr_rules_hash_key,
- zebra_pbr_rules_hash_equal, "Rules Hash");
-
zrouter.qdisc_hash =
hash_create_size(8, zebra_tc_qdisc_hash_key,
zebra_tc_qdisc_hash_equal, "TC (qdisc) Hash");
@@ -323,6 +343,8 @@ void zebra_router_init(bool asic_offload, bool notify_on_ack,
#endif
zrouter.asic_notification_nexthop_control = false;
+ zrouter.nexthop_weight_scale_value = 255;
+
#ifdef HAVE_SCRIPTING
zebra_script_init();
#endif