]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Rename
authorIgor Putovny <igor.putovny@nic.cz>
Fri, 7 Mar 2025 14:08:59 +0000 (15:08 +0100)
committerIgor Putovny <igor.putovny@nic.cz>
Fri, 7 Mar 2025 14:08:59 +0000 (15:08 +0100)
proto/aggregator/aggregator.c
proto/aggregator/aggregator.h
proto/aggregator/trie.c

index 9bb180519cdd2fb8187660349e91d22e0cbdeb5e..057138517ebda38d9d2e2d854640d70456cc1052 100644 (file)
@@ -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.
index fda4fe199186d686a78feb436bb7ca72fdd881f7..f83d4dc407d3a526ea6601b67d4bb0f225c102bb 100644 (file)
@@ -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
index 877b5e6452b50b3f6b871d858d9606a60e2ee238..f2e4c1530061f0ee903c21db59222d0ee5ec408b 100644 (file)
@@ -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 */