mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 18:42:48 +00:00
lib: break up show nexthop API a bit for reuse
Not everything cares about the vrf and backup info. Break up the API to add a simple version to just write gateway/interface info. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
This commit is contained in:
parent
da2f670078
commit
7992452008
@ -952,11 +952,10 @@ static struct cmd_node nexthop_group_node = {
|
||||
.config_write = nexthop_group_write,
|
||||
};
|
||||
|
||||
void nexthop_group_write_nexthop(struct vty *vty, const struct nexthop *nh)
|
||||
void nexthop_group_write_nexthop_simple(struct vty *vty,
|
||||
const struct nexthop *nh)
|
||||
{
|
||||
char buf[100];
|
||||
struct vrf *vrf;
|
||||
int i;
|
||||
|
||||
vty_out(vty, "nexthop ");
|
||||
|
||||
@ -983,6 +982,14 @@ void nexthop_group_write_nexthop(struct vty *vty, const struct nexthop *nh)
|
||||
case NEXTHOP_TYPE_BLACKHOLE:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void nexthop_group_write_nexthop(struct vty *vty, const struct nexthop *nh)
|
||||
{
|
||||
struct vrf *vrf;
|
||||
int i;
|
||||
|
||||
nexthop_group_write_nexthop_simple(vty, nh);
|
||||
|
||||
if (nh->vrf_id != VRF_DEFAULT) {
|
||||
vrf = vrf_lookup_by_id(nh->vrf_id);
|
||||
|
@ -135,6 +135,8 @@ extern bool nexthop_group_equal(const struct nexthop_group *nhg1,
|
||||
|
||||
extern struct nexthop_group_cmd *nhgc_find(const char *name);
|
||||
|
||||
extern void nexthop_group_write_nexthop_simple(struct vty *vty,
|
||||
const struct nexthop *nh);
|
||||
extern void nexthop_group_write_nexthop(struct vty *vty,
|
||||
const struct nexthop *nh);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user