From: Igor Putovny Date: Fri, 7 Mar 2025 14:08:59 +0000 (+0100) Subject: Rename X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a81e5af3fdadf6affb9c1f1b67a0b69552a59bb6;p=thirdparty%2Fbird.git Rename --- diff --git a/proto/aggregator/aggregator.c b/proto/aggregator/aggregator.c index 9bb180519..057138517 100644 --- a/proto/aggregator/aggregator.c +++ b/proto/aggregator/aggregator.c @@ -208,7 +208,7 @@ aggregator_rta_set_static_attr(struct rta *rta, const struct rta *old, struct f_ * @count: number of &f_val entries */ static int -same_val_list(const struct f_val *v1, const struct f_val *v2, uint len) +aggregator_same_val_list(const struct f_val *v1, const struct f_val *v2, u32 len) { for (u32 i = 0; i < len; i++) if (!val_same(&v1[i], &v2[i])) @@ -488,7 +488,7 @@ HASH_DEFINE_REHASH_FN(AGGR_RTE, struct aggregator_route); #define AGGR_BUCK_KEY(n) (n) #define AGGR_BUCK_NEXT(n) ((n)->next_hash) -#define AGGR_BUCK_EQ(a,b) (((a)->hash == (b)->hash) && (same_val_list((a)->aggr_data, (b)->aggr_data, p->aggr_on_count))) +#define AGGR_BUCK_EQ(a,b) (((a)->hash == (b)->hash) && (aggregator_same_val_list((a)->aggr_data, (b)->aggr_data, p->aggr_on_count))) #define AGGR_BUCK_FN(n) ((n)->hash) #define AGGR_BUCK_ORDER 4 /* Initial */ @@ -839,7 +839,7 @@ aggregator_init_trie(struct aggregator_proto *p) HASH_INSERT2(p->buckets, AGGR_BUCK, p->p.pool, new_bucket); /* Create root node */ - p->root = aggregator_create_new_node(p->trie_slab); + p->root = aggregator_alloc_node(p->trie_slab); /* * Root node is initialized with NON_FIB status. diff --git a/proto/aggregator/aggregator.h b/proto/aggregator/aggregator.h index fda4fe199..f83d4dc40 100644 --- a/proto/aggregator/aggregator.h +++ b/proto/aggregator/aggregator.h @@ -68,11 +68,11 @@ struct aggregator_proto { /* Buckets by aggregator rule */ HASH(struct aggregator_bucket) buckets; - linpool *bucket_pool; + struct linpool *bucket_pool; /* Routes by net and src */ HASH(struct aggregator_route) routes; - linpool *route_pool; + struct linpool *route_pool; /* Aggregator rule */ u32 aggr_on_count; @@ -97,7 +97,7 @@ struct aggregator_proto { struct hmap bucket_id_map; /* Route withdrawal */ - linpool *rte_withdrawal_pool; + struct linpool *rte_withdrawal_pool; struct rte_withdrawal_item *rte_withdrawal_stack; int rte_withdrawal_count; }; @@ -151,6 +151,6 @@ void aggregator_aggregate(struct aggregator_proto *p); void aggregator_recompute(struct aggregator_proto *p, struct aggregator_route *old, struct aggregator_route *new); void aggregator_bucket_update(struct aggregator_proto *p, struct aggregator_bucket *bucket, struct network *net); -struct trie_node *aggregator_create_new_node(struct slab *trie_slab); +struct trie_node *aggregator_alloc_node(struct slab *trie_slab); #endif diff --git a/proto/aggregator/trie.c b/proto/aggregator/trie.c index 877b5e645..f2e4c1530 100644 --- a/proto/aggregator/trie.c +++ b/proto/aggregator/trie.c @@ -93,7 +93,7 @@ static const u32 ipa_shift[] = { */ // TODO: inline in aggregator.h? struct trie_node * -aggregator_create_new_node(struct slab *trie_slab) +aggregator_alloc_node(struct slab *trie_slab) { return sl_allocz(trie_slab); } @@ -234,12 +234,12 @@ aggregator_merge_potential_buckets(struct trie_node *target, const struct trie_n int has_changed = 0; int buckets_count = 0; - u32 old[ARRAY_SIZE(target->potential_buckets)] = { 0 }; + u32 before[ARRAY_SIZE(target->potential_buckets)] = { 0 }; for (int i = 0; i < POTENTIAL_BUCKETS_BITMAP_SIZE; i++) { /* Save current bitmap values */ - old[i] = target->potential_buckets[i]; + before[i] = target->potential_buckets[i]; /* Compute intersection */ has_intersection |= !!(target->potential_buckets[i] = left->potential_buckets[i] & right->potential_buckets[i]); @@ -249,7 +249,7 @@ aggregator_merge_potential_buckets(struct trie_node *target, const struct trie_n * If old and new values are different, the result of their XOR will be * non-zero, thus @has_changed will be set to non-zero -- true, as well. */ - has_changed |= !!(old[i] ^ target->potential_buckets[i]); + has_changed |= !!(before[i] ^ target->potential_buckets[i]); } /* Sets have an empty intersection, compute their union instead */ @@ -262,7 +262,7 @@ aggregator_merge_potential_buckets(struct trie_node *target, const struct trie_n { target->potential_buckets[i] = left->potential_buckets[i] | right->potential_buckets[i]; buckets_count += u32_popcount(target->potential_buckets[i]); - has_changed |= !!(old[i] ^ target->potential_buckets[i]); + has_changed |= !!(before[i] ^ target->potential_buckets[i]); } } @@ -438,7 +438,7 @@ aggregator_trie_insert_prefix(struct aggregator_proto *p, ip_addr prefix, u32 px if (!node->child[bit]) { - struct trie_node *new = aggregator_create_new_node(p->trie_slab); + struct trie_node *new = aggregator_alloc_node(p->trie_slab); *new = (struct trie_node) { .parent = node, @@ -743,7 +743,7 @@ aggregator_third_pass_helper(struct aggregator_proto *p, struct trie_node *node, */ if (!aggregator_is_bucket_potential(&imaginary_node, imaginary_node_inherited_bucket)) { - struct trie_node *new = aggregator_create_new_node(p->trie_slab); + struct trie_node *new = aggregator_alloc_node(p->trie_slab); *new = imaginary_node; /* Connect new node to the trie */