summaryrefslogtreecommitdiff
path: root/lib/nexthop_group.c
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2020-08-18 16:53:44 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2020-08-27 16:13:48 -0400
commit79924520085ec6a7ac368e62226e3ad5ff9cc025 (patch)
treec06fb55f0ffd1c1d47c39a1c41d8a9b02eba1e46 /lib/nexthop_group.c
parentda2f67007844948e5d0d2ecdf24ae7124468e47a (diff)
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>
Diffstat (limited to 'lib/nexthop_group.c')
-rw-r--r--lib/nexthop_group.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/nexthop_group.c b/lib/nexthop_group.c
index 8ae001e42a..696b17fedc 100644
--- a/lib/nexthop_group.c
+++ b/lib/nexthop_group.c
@@ -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);