ASSERT_DIE(p->aggr_mode == PREFIX_AGGR);
ASSERT_DIE(p->root != NULL);
- p->initial_feed = 0;
aggregator_aggregate(p);
+ p->initial_feed = false;
}
/*
.data = p,
};
- p->initial_feed = 1;
-
- hmap_init(&p->bucket_id_map, p->p.pool, 1024);
+ hmap_init(&p->bucket_id_map, P->pool, 1024);
hmap_set(&p->bucket_id_map, 0); /* 0 is default value, do not use it as ID */
+ p->initial_feed = true;
+
if (p->aggr_mode == PREFIX_AGGR)
{
ASSERT_DIE(p->trie_slab == NULL);
ASSERT_DIE(p->bucket_list_count == 0);
p->bucket_list_size = BUCKET_LIST_INIT_SIZE;
- p->bucket_list = mb_allocz(p->p.pool, sizeof(p->bucket_list[0]) * p->bucket_list_size);
+ p->bucket_list = mb_allocz(P->pool, sizeof(p->bucket_list[0]) * p->bucket_list_size);
p->rte_withdrawal_pool = lp_new(P->pool);
p->rte_withdrawal_count = 0;
p->bucket_id_map = (struct hmap) { 0 };
- p->initial_feed = 1;
+ p->initial_feed = true;
}
static int
HASH(struct aggregator_route) routes;
struct linpool *route_pool;
+ /* Bucket IDs */
+ struct hmap bucket_id_map;
+
/* Aggregator rule */
+ struct aggr_item *aggr_on;
u32 aggr_on_count;
u32 aggr_on_da_count;
- struct aggr_item *aggr_on;
/* Merge filter */
const struct f_line *merge_by;
event reload_buckets;
/* Aggregation trie */
- u32 addr_type;
struct trie_node *root;
struct slab *trie_slab;
- int initial_feed;
- int logging;
+ u32 addr_type;
+ bool initial_feed;
+ bool logging;
/* Array of bucket pointers */
struct aggregator_bucket **bucket_list;
- size_t bucket_list_size;
- size_t bucket_list_count;
-
- /* Bucket IDs */
- struct hmap bucket_id_map;
+ uint bucket_list_size;
+ int bucket_list_count;
/* Route withdrawal */
struct rte_withdrawal_item *rte_withdrawal_stack;
AGGREGATOR_CFG->aggr_mode = PREFIX_AGGR;
AGGREGATOR_CFG->src->ra_mode = RA_OPTIMAL;
AGGREGATOR_CFG->dst->ra_mode = RA_ANY;
- AGGREGATOR_CFG->logging = 0;
+ AGGREGATOR_CFG->logging = false;
};
aggregator_proto_item:
$4->args++;
AGGREGATOR_CFG->merge_by = $4;
}
- | LOG ALL { AGGREGATOR_CFG->logging = 1; }
+ | LOG ALL { AGGREGATOR_CFG->logging = true; }
;
aggregator_proto_opts: /* empty */ | aggregator_proto_opts aggregator_proto_item ';' ;
#include "filter/filter.h"
#include "proto/aggregator/aggregator.h"
-#include <stdbool.h>
-
static const char *px_origin_str[] = {
[FILLER] = "filler",
[ORIGINAL] = "original",