0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2025-03-11 17:08:46 +00:00

Add get_status() function

This commit is contained in:
Igor Putovny 2024-06-19 12:30:34 +02:00
parent 9c43264985
commit 1e739986c2

@ -1736,6 +1736,22 @@ aggregator_reconfigure(struct proto *P, struct proto_config *CF)
return 1;
}
static void
aggregator_get_status(struct proto *P, byte *buf)
{
struct aggregator_proto *p = SKIP_BACK(struct aggregator_proto, p, P);
if (p->p.proto_state == PS_DOWN)
buf[0] = 0;
else
{
if (PREFIX_AGGR == p->aggr_mode)
strcpy(buf, "prefix aggregation");
else
strcpy(buf, "net aggregation");
}
}
struct protocol proto_aggregator = {
.name = "Aggregator",
.template = "aggregator%d",
@ -1749,6 +1765,7 @@ struct protocol proto_aggregator = {
.start = aggregator_start,
.shutdown = aggregator_shutdown,
.reconfigure = aggregator_reconfigure,
.get_status = aggregator_get_status,
};
void