static void
cf_lex_init_kh(void)
{
- HASH_INIT(kw_hash, &root_pool, KW_ORDER);
+ HASH_INIT(kw_hash, config_pool, KW_ORDER);
struct keyword *k;
for (k=keyword_list; k->name; k++)
static jmp_buf conf_jmpbuf;
struct config *config, *new_config;
+pool *config_pool;
static struct config *old_config; /* Old configuration */
static struct config *future_config; /* New config held here if recon requested during recon */
struct config *
config_alloc(const char *name)
{
- pool *p = rp_new(&root_pool, "Config");
+ pool *p = rp_new(config_pool, "Config");
linpool *l = lp_new_default(p);
struct config *c = lp_allocz(l, sizeof(struct config));
void
config_init(void)
{
- config_event = ev_new(&root_pool);
+ config_pool = rp_new(&root_pool, "Configurations");
+
+ config_event = ev_new(config_pool);
config_event->hook = config_done;
- config_timer = tm_new(&root_pool);
+ config_timer = tm_new(config_pool);
config_timer->hook = config_timeout;
}
/* Pools */
-
+extern pool *config_pool;
extern linpool *cfg_mem;
#define cfg_alloc(size) lp_alloc(cfg_mem, size)
flow_builder_init:
{
if (this_flow == NULL)
- this_flow = flow_builder_init(&root_pool);
+ this_flow = flow_builder_init(config_pool); /* FIXME: This should be allocated from tmp in future */
else
flow_builder_clear(this_flow);
};
static int inited = 0;
if (!inited) {
- idm_init(&ca_idm, &root_pool, 8);
- HASH_INIT(ca_hash, &root_pool, CA_ORDER);
+ idm_init(&ca_idm, config_pool, 8);
+ HASH_INIT(ca_hash, config_pool, CA_ORDER);
ca_storage_max = 256;
- ca_storage = mb_allocz(&root_pool, sizeof(struct ca_storage *) * ca_storage_max);
+ ca_storage = mb_allocz(config_pool, sizeof(struct ca_storage *) * ca_storage_max);
inited++;
}
ca_storage = mb_realloc(ca_storage, sizeof(struct ca_storage *) * ca_storage_max * 2);
}
- cas = mb_allocz(&root_pool, sizeof(struct ca_storage) + strlen(name) + 1);
+ cas = mb_allocz(config_pool, sizeof(struct ca_storage) + strlen(name) + 1);
cas->fda = f_new_dynamic_attr(ea_type, f_type, EA_CUSTOM(id));
cas->uc = 1;
print_size("Routing tables:", rmemsize(rt_table_pool));
print_size("Route attributes:", rmemsize(rta_pool));
print_size("Protocols:", rmemsize(proto_pool));
+ print_size("Current config:", rmemsize(config_pool));
struct resmem total = rmemsize(&root_pool);
#ifdef HAVE_MMAP
print_size("Standby memory:", (struct resmem) { .overhead = page_size * *pages_kept });