From: Igor Putovny Date: Fri, 6 Dec 2024 15:01:55 +0000 (+0100) Subject: Add prefix origin X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba5c38e179e30ef290dc870c917b4b583e4e8230;p=thirdparty%2Fbird.git Add prefix origin --- diff --git a/proto/aggregator/aggregator.c b/proto/aggregator/aggregator.c index 94bed8add..40f5dbe0d 100644 --- a/proto/aggregator/aggregator.c +++ b/proto/aggregator/aggregator.c @@ -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; } diff --git a/proto/aggregator/aggregator.h b/proto/aggregator/aggregator.h index 07a91c510..950fab6c9 100644 --- a/proto/aggregator/aggregator.h +++ b/proto/aggregator/aggregator.h @@ -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; };