]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Incorporate updates into trie
authorIgor Putovny <igor.putovny@nic.cz>
Mon, 9 Dec 2024 17:06:15 +0000 (18:06 +0100)
committerIgor Putovny <igor.putovny@nic.cz>
Mon, 9 Dec 2024 17:06:15 +0000 (18:06 +0100)
proto/aggregator/aggregator.c

index 58c720b7b4a8df34ad531265d980fad35ba4df23..bdcc3ff924e191ccba5cf34a1bdc509ff203a285 100644 (file)
@@ -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)
 {