* Check if @bucket is one of potential buckets in @node
*/
static int
-is_bucket_potential(const struct trie_node *node, const struct aggregator_bucket *bucket)
+node_is_bucket_potential(const struct trie_node *node, const struct aggregator_bucket *bucket)
{
assert(node != NULL);
assert(bucket != NULL);
* Insert @bucket to the list of bucket pointers in @p to position @bucket-ID
*/
static void
-proto_insert_bucket(struct aggregator_proto *p, struct aggregator_bucket *bucket)
+agregator_insert_bucket(struct aggregator_proto *p, struct aggregator_bucket *bucket)
{
assert(p != NULL);
assert(p->bucket_list != NULL);
* Push routewhich is to be withdrawed on the stack
*/
static void
-prepare_rte_withdrawal(struct aggregator_proto *p, ip_addr prefix, u32 pxlen, struct aggregator_bucket *bucket)
+aggregator_prepare_rte_withdrawal(struct aggregator_proto *p, ip_addr prefix, u32 pxlen, struct aggregator_bucket *bucket)
{
assert(p != NULL);
assert(bucket != NULL);
}
static struct trie_node *
-trie_remove_prefix(struct aggregator_proto *p, ip_addr prefix, u32 pxlen)
+aggregator_remove_prefix(struct aggregator_proto *p, ip_addr prefix, u32 pxlen)
{
struct trie_node *node = p->root;
/* If this prefix was IN_FIB, remove its route */
if (IN_FIB == node->status)
- prepare_rte_withdrawal(p, prefix, pxlen, node->selected_bucket);
+ aggregator_prepare_rte_withdrawal(p, prefix, pxlen, node->selected_bucket);
node->status = NON_FIB;
node->px_origin = FILLER;
* of this node, then this node doesn't need a bucket because it inherits
* one, and is not needed in FIB.
*/
- if (is_bucket_potential(node, inherited_bucket))
+ if (node_is_bucket_potential(node, inherited_bucket))
{
/*
* Prefix status is changing from IN_FIB to NON_FIB, thus its route
assert(node->px_origin == ORIGINAL || node->px_origin == AGGREGATED);
assert(node->selected_bucket != NULL);
- prepare_rte_withdrawal(p, *prefix, pxlen, node->selected_bucket);
+ aggregator_prepare_rte_withdrawal(p, *prefix, pxlen, node->selected_bucket);
}
node->selected_bucket = NULL;
* If this condition is met, we need to allocate these nodes and
* connect them to the trie.
*/
- if (!is_bucket_potential(&imaginary_node, imaginary_node_inherited_bucket))
+ if (!node_is_bucket_potential(&imaginary_node, imaginary_node_inherited_bucket))
{
struct trie_node *new = create_new_node(p->trie_pool);
*new = imaginary_node;
const ip_addr prefix = net_prefix(addr);
const u32 pxlen = net_pxlen(addr);
- struct trie_node *updated_node = trie_remove_prefix(p, prefix, pxlen);
+ struct trie_node *updated_node = aggregator_remove_prefix(p, prefix, pxlen);
assert(updated_node != NULL);
dump_trie(p);
HASH_INSERT2(p->buckets, AGGR_BUCK, p->p.pool, new_bucket);
new_bucket->id = get_new_bucket_id(p);
- proto_insert_bucket(p, new_bucket);
+ agregator_insert_bucket(p, new_bucket);
}
/* Store the route attributes */
/* Assign ID to the root node bucket */
new_bucket->id = get_new_bucket_id(p);
- proto_insert_bucket(p, new_bucket);
+ agregator_insert_bucket(p, new_bucket);
assert(get_bucket_ptr(p, new_bucket->id) == new_bucket);
struct aggregator_route *arte = lp_allocz(p->route_pool, sizeof(*arte));