0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2025-01-18 06:51:54 +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

View File

@ -1736,6 +1736,22 @@ aggregator_reconfigure(struct proto *P, struct proto_config *CF)
return 1; 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 = { struct protocol proto_aggregator = {
.name = "Aggregator", .name = "Aggregator",
.template = "aggregator%d", .template = "aggregator%d",
@ -1749,6 +1765,7 @@ struct protocol proto_aggregator = {
.start = aggregator_start, .start = aggregator_start,
.shutdown = aggregator_shutdown, .shutdown = aggregator_shutdown,
.reconfigure = aggregator_reconfigure, .reconfigure = aggregator_reconfigure,
.get_status = aggregator_get_status,
}; };
void void