* Insert prefix in @addr to prefix trie with root at @node
*/
static void
-trie_insert_prefix(const union net_addr_union *addr, const struct aggregator_bucket *bucket, struct trie_node * const root, slab *trie_slab)
+trie_insert_prefix(const union net_addr_union *addr, struct aggregator_bucket *bucket, struct trie_node * const root, slab *trie_slab)
{
assert(addr != NULL);
assert(bucket != NULL);
return;
}
+ /* Add leaves so that each node has either two or no children */
for (int i = 0; i < 2; i++)
{
if (!node->child[i])
node->bucket = NULL;
}
+/*
+ * Compare two bucket pointers
+ */
static int
aggregator_bucket_compare(const void *a, const void *b)
{
* Check if @bucket is one of potential nexthop buckets in @node
*/
static int
-bucket_is_present(const struct aggregator_bucket *bucket, const struct trie_node *node)
+is_bucket_potential(const struct aggregator_bucket *bucket, const struct trie_node *node)
{
for (int i = 0; i < node->potential_buckets_count; i++)
if (node->potential_buckets[i] == bucket)