]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Add prefix origin
authorIgor Putovny <igor.putovny@nic.cz>
Fri, 6 Dec 2024 15:01:55 +0000 (16:01 +0100)
committerIgor Putovny <igor.putovny@nic.cz>
Fri, 6 Dec 2024 15:01:55 +0000 (16:01 +0100)
proto/aggregator/aggregator.c
proto/aggregator/aggregator.h

index 94bed8adde8145e4d10144e2e15c01770deeefe9..40f5dbe0d60b70de804d0e13bf28f5e09b8623cc 100644 (file)
@@ -328,6 +328,7 @@ trie_insert_prefix_ip4(struct trie_node * const root, const struct net_addr_ip4
   /* Assign bucket to the last node */
   node->original_bucket = bucket;
   node->status = IN_FIB;
+  node->px_origin = ORIGINAL;
 
   return node;
 }
@@ -366,6 +367,7 @@ trie_insert_prefix_ip6(struct trie_node * const root, const struct net_addr_ip6
   /* Assign bucket to the last node */
   node->original_bucket = bucket;
   node->status = IN_FIB;
+  node->px_origin = ORIGINAL;
 
   return node;
 }
index 07a91c5105c3cbd7372e6863fe49da6d360f8ccd..950fab6c9e1756cfde42dfa7b14b8613650dbcce 100644 (file)
@@ -117,6 +117,12 @@ enum fib_status {
   NON_FIB = 2,
 };
 
+enum prefix_origin {
+  SOURCELESS = 0,
+  ORIGINAL = 1,
+  AGGREGATED = 2,
+};
+
 struct trie_node {
   struct trie_node *parent;
   struct trie_node *child[2];
@@ -125,6 +131,7 @@ struct trie_node {
   struct aggregator_bucket *selected_bucket;
   u32 potential_buckets[POTENTIAL_BUCKETS_BITMAP_SIZE];
   enum fib_status status;
+  enum prefix_origin px_origin;
   int potential_buckets_count;
   int depth;
 };