mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +00:00
Show info from multiple protocols when protocol is not specified
Most commands like 'show ospf neighbors' fail when protocol is not specified and there are multiple instances of given protocol type. This is annoying in BIRD 2, as many protocols have IPv4 and IPv6 instances. The patch changes that by showing output from all protocol instances of appropriate type. Note that the patch also removes terminating cli_msg() call from these commands and moves it to the common iterating code.
This commit is contained in:
@@ -196,10 +196,10 @@ dynamic_attr: RIP_TAG { $$ = f_new_dynamic_attr(EAF_TYPE_INT, T_INT, EA_RIP_TAG)
|
||||
CF_CLI_HELP(SHOW RIP, ..., [[Show information about RIP protocol]]);
|
||||
|
||||
CF_CLI(SHOW RIP INTERFACES, optproto opttext, [<name>] [\"<interface>\"], [[Show information about RIP interfaces]])
|
||||
{ rip_show_interfaces(proto_get_named($4, &proto_rip), $5); };
|
||||
{ PROTO_WALK_CMD($4, &proto_rip, p) rip_show_interfaces(p, $5); };
|
||||
|
||||
CF_CLI(SHOW RIP NEIGHBORS, optproto opttext, [<name>] [\"<interface>\"], [[Show information about RIP neighbors]])
|
||||
{ rip_show_neighbors(proto_get_named($4, &proto_rip), $5); };
|
||||
{ PROTO_WALK_CMD($4, &proto_rip, p) rip_show_neighbors(p, $5); };
|
||||
|
||||
|
||||
CF_CODE
|
||||
|
||||
@@ -1232,7 +1232,6 @@ rip_show_interfaces(struct proto *P, const char *iff)
|
||||
if (p->p.proto_state != PS_UP)
|
||||
{
|
||||
cli_msg(-1021, "%s: is not up", p->p.name);
|
||||
cli_msg(0, "");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1256,8 +1255,6 @@ rip_show_interfaces(struct proto *P, const char *iff)
|
||||
cli_msg(-1021, "%-10s %-6s %6u %6u %7t",
|
||||
ifa->iface->name, (ifa->up ? "Up" : "Down"), ifa->cf->metric, nbrs, timer);
|
||||
}
|
||||
|
||||
cli_msg(0, "");
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1270,7 +1267,6 @@ rip_show_neighbors(struct proto *P, const char *iff)
|
||||
if (p->p.proto_state != PS_UP)
|
||||
{
|
||||
cli_msg(-1022, "%s: is not up", p->p.name);
|
||||
cli_msg(0, "");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1293,8 +1289,6 @@ rip_show_neighbors(struct proto *P, const char *iff)
|
||||
n->nbr->addr, ifa->iface->name, ifa->cf->metric, n->uc, timer);
|
||||
}
|
||||
}
|
||||
|
||||
cli_msg(0, "");
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user