From: Igor Putovny Date: Mon, 9 Dec 2024 17:06:15 +0000 (+0100) Subject: Incorporate updates into trie X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b203555f8fe9c35e3fa605ec11e91fc172c4510;p=thirdparty%2Fbird.git Incorporate updates into trie --- diff --git a/proto/aggregator/aggregator.c b/proto/aggregator/aggregator.c index 58c720b7b..bdcc3ff92 100644 --- a/proto/aggregator/aggregator.c +++ b/proto/aggregator/aggregator.c @@ -784,6 +784,9 @@ merge_buckets_above(struct trie_node *node) return node; } +static void dump_trie(const struct trie_node *); +static void print_prefixes(const struct trie_node *, int); + static void trie_receive_update(struct aggregator_proto *p, struct aggregator_route *old, struct aggregator_route *new) { @@ -835,6 +838,30 @@ trie_receive_update(struct aggregator_proto *p, struct aggregator_route *old, st assert(updated_node->status == IN_FIB); } + dump_trie(p->root); + + log("deaggregate"); + deaggregate(updated_node); + dump_trie(p->root); + + log("first pass"); + first_pass(updated_node); + dump_trie(p->root); + + log("second pass"); + second_pass(updated_node); + dump_trie(p->root); + + log("merge buckets above"); + struct trie_node *highest_node = merge_buckets_above(updated_node); + dump_trie(p->root); + + log("third pass"); + assert(highest_node->parent != NULL); + third_pass(p, highest_node->parent); + dump_trie(p->root); +} + static void dump_trie_helper(const struct trie_node *node, struct net_addr_ip4 *addr, struct buffer *buf) {