mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-09 12:48:43 +00:00
Rename
This commit is contained in:
parent
0ebaf2ec18
commit
c892b2d02f
@ -900,7 +900,7 @@ run_aggregation(struct aggregator_proto *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
flush_trie(struct aggregator_proto *p)
|
flush_aggregator(struct aggregator_proto *p)
|
||||||
{
|
{
|
||||||
lp_flush(p->bucket_pool);
|
lp_flush(p->bucket_pool);
|
||||||
lp_flush(p->route_pool);
|
lp_flush(p->route_pool);
|
||||||
@ -929,7 +929,7 @@ aggregate_on_feed_end(struct channel *C)
|
|||||||
if (C == p->src)
|
if (C == p->src)
|
||||||
{
|
{
|
||||||
run_aggregation(p);
|
run_aggregation(p);
|
||||||
flush_trie(p);
|
flush_aggregator(p);
|
||||||
p->root = NULL;
|
p->root = NULL;
|
||||||
|
|
||||||
if (p->first_run)
|
if (p->first_run)
|
||||||
@ -1497,7 +1497,7 @@ aggregator_rt_notify(struct proto *P, struct channel *src_ch, net *net, rte *new
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert(p->root != NULL);
|
assert(p->root != NULL);
|
||||||
settle_kick(&p->aggr_timer);
|
settle_kick(&p->notify_settle);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -1555,7 +1555,7 @@ aggregator_init(struct proto_config *CF)
|
|||||||
p->aggr_on = cf->aggr_on;
|
p->aggr_on = cf->aggr_on;
|
||||||
p->net_present = cf->net_present;
|
p->net_present = cf->net_present;
|
||||||
p->merge_by = cf->merge_by;
|
p->merge_by = cf->merge_by;
|
||||||
p->aggr_timer_cf = cf->aggr_timer_cf;
|
p->notify_settle_cf = cf->notify_settle_cf;
|
||||||
|
|
||||||
P->rt_notify = aggregator_rt_notify;
|
P->rt_notify = aggregator_rt_notify;
|
||||||
P->preexport = aggregator_preexport;
|
P->preexport = aggregator_preexport;
|
||||||
@ -1652,7 +1652,7 @@ aggregator_start(struct proto *P)
|
|||||||
p->first_run = 1;
|
p->first_run = 1;
|
||||||
p->aggr_done = 0;
|
p->aggr_done = 0;
|
||||||
|
|
||||||
settle_init(&p->aggr_timer, &p->aggr_timer_cf, aggregate_on_settle_timer, p);
|
settle_init(&p->notify_settle, &p->notify_settle_cf, aggregate_on_settle_timer, p);
|
||||||
|
|
||||||
return PS_UP;
|
return PS_UP;
|
||||||
}
|
}
|
||||||
@ -1678,7 +1678,7 @@ aggregator_shutdown(struct proto *P)
|
|||||||
}
|
}
|
||||||
HASH_WALK_END;
|
HASH_WALK_END;
|
||||||
|
|
||||||
settle_cancel(&p->aggr_timer);
|
settle_cancel(&p->notify_settle);
|
||||||
|
|
||||||
assert(p->root != NULL);
|
assert(p->root != NULL);
|
||||||
p->root = NULL;
|
p->root = NULL;
|
||||||
@ -1695,7 +1695,7 @@ aggregator_reconfigure(struct proto *P, struct proto_config *CF)
|
|||||||
TRACE(D_EVENTS, "Reconfiguring");
|
TRACE(D_EVENTS, "Reconfiguring");
|
||||||
|
|
||||||
/* Compare timer configuration */
|
/* Compare timer configuration */
|
||||||
if (cf->aggr_timer_cf.min != p->aggr_timer_cf.min || cf->aggr_timer_cf.max != p->aggr_timer_cf.max)
|
if (cf->notify_settle_cf.min != p->notify_settle_cf.min || cf->notify_settle_cf.max != p->notify_settle_cf.max)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Compare numeric values (shortcut) */
|
/* Compare numeric values (shortcut) */
|
||||||
|
@ -28,7 +28,7 @@ struct aggregator_config {
|
|||||||
struct aggr_item *aggr_on;
|
struct aggr_item *aggr_on;
|
||||||
int net_present;
|
int net_present;
|
||||||
const struct f_line *merge_by;
|
const struct f_line *merge_by;
|
||||||
struct settle_config aggr_timer_cf;
|
struct settle_config notify_settle_cf;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct aggregator_route {
|
struct aggregator_route {
|
||||||
@ -74,8 +74,8 @@ struct aggregator_proto {
|
|||||||
uint addr_type;
|
uint addr_type;
|
||||||
linpool *trie_pool;
|
linpool *trie_pool;
|
||||||
struct trie_node *root;
|
struct trie_node *root;
|
||||||
struct settle_config aggr_timer_cf;
|
struct settle_config notify_settle_cf;
|
||||||
struct settle aggr_timer;
|
struct settle notify_settle;
|
||||||
int before_count;
|
int before_count;
|
||||||
int after_count;
|
int after_count;
|
||||||
int aggr_done;
|
int aggr_done;
|
||||||
|
@ -38,7 +38,7 @@ aggregator_proto_start: proto_start AGGREGATOR
|
|||||||
AGGREGATOR_CFG->dst = channel_config_new(NULL, "destination", 0, this_proto);
|
AGGREGATOR_CFG->dst = channel_config_new(NULL, "destination", 0, this_proto);
|
||||||
AGGREGATOR_CFG->src->ra_mode = AGGREGATOR_CFG->dst->ra_mode = RA_ANY;
|
AGGREGATOR_CFG->src->ra_mode = AGGREGATOR_CFG->dst->ra_mode = RA_ANY;
|
||||||
|
|
||||||
AGGREGATOR_CFG->aggr_timer_cf = (struct settle_config) {
|
AGGREGATOR_CFG->notify_settle_cf = (struct settle_config) {
|
||||||
.min = 10 MS_,
|
.min = 10 MS_,
|
||||||
.max = 100 MS_,
|
.max = 100 MS_,
|
||||||
};
|
};
|
||||||
@ -84,7 +84,7 @@ aggregator_proto_item:
|
|||||||
$4->args++;
|
$4->args++;
|
||||||
AGGREGATOR_CFG->merge_by = $4;
|
AGGREGATOR_CFG->merge_by = $4;
|
||||||
}
|
}
|
||||||
| RELOAD AFTER settle { AGGREGATOR_CFG->aggr_timer_cf = $3; }
|
| RELOAD AFTER settle { AGGREGATOR_CFG->notify_settle_cf = $3; }
|
||||||
;
|
;
|
||||||
|
|
||||||
aggregator_proto_opts: /* empty */ | aggregator_proto_opts aggregator_proto_item ';' ;
|
aggregator_proto_opts: /* empty */ | aggregator_proto_opts aggregator_proto_item ';' ;
|
||||||
|
Loading…
Reference in New Issue
Block a user