summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2021-10-21 15:17:41 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2022-03-27 14:57:18 +0200
commit6c90403bb183838a40fc2ed49b25976495366850 (patch)
tree80e4f8eea055a108cf022fd18e920792f2d15ccb
parentzebra: register NHT nexthops with proper SAFI (diff)
downloadfrr-6c90403bb183838a40fc2ed49b25976495366850.tar.xz
frr-6c90403bb183838a40fc2ed49b25976495366850.zip
zebra: `show ip nht mrib`
Prints the SAFI_MULTICAST NHT state in zebra. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
-rw-r--r--zebra/zebra_rnh.c6
-rw-r--r--zebra/zebra_rnh.h4
-rw-r--r--zebra/zebra_vty.c12
3 files changed, 12 insertions, 10 deletions
diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c
index 9a2b81bc2..d439b1dbc 100644
--- a/zebra/zebra_rnh.c
+++ b/zebra/zebra_rnh.c
@@ -802,13 +802,13 @@ void zebra_evaluate_rnh(struct zebra_vrf *zvrf, afi_t afi, int force,
}
}
-void zebra_print_rnh_table(vrf_id_t vrfid, afi_t afi, struct vty *vty,
- struct prefix *p)
+void zebra_print_rnh_table(vrf_id_t vrfid, afi_t afi, safi_t safi,
+ struct vty *vty, struct prefix *p)
{
struct route_table *table;
struct route_node *rn;
- table = get_rnh_table(vrfid, afi, SAFI_UNICAST);
+ table = get_rnh_table(vrfid, afi, safi);
if (!table) {
if (IS_ZEBRA_DEBUG_NHT)
zlog_debug("print_rnhs: rnh table not found");
diff --git a/zebra/zebra_rnh.h b/zebra/zebra_rnh.h
index c8e7dda43..3991066d1 100644
--- a/zebra/zebra_rnh.h
+++ b/zebra/zebra_rnh.h
@@ -45,8 +45,8 @@ extern void zebra_deregister_rnh_pseudowire(vrf_id_t, struct zebra_pw *);
extern void zebra_remove_rnh_client(struct rnh *rnh, struct zserv *client);
extern void zebra_evaluate_rnh(struct zebra_vrf *zvrf, afi_t afi, int force,
struct prefix *p, safi_t safi);
-extern void zebra_print_rnh_table(vrf_id_t vrfid, afi_t afi, struct vty *vty,
- struct prefix *p);
+extern void zebra_print_rnh_table(vrf_id_t vrfid, afi_t afi, safi_t safi,
+ struct vty *vty, struct prefix *p);
extern int rnh_resolve_via_default(struct zebra_vrf *zvrf, int family);
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 32bbfd665..22c65e3c0 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -1361,7 +1361,7 @@ static int do_show_ip_route(struct vty *vty, const char *vrf_name, afi_t afi,
DEFPY (show_ip_nht,
show_ip_nht_cmd,
- "show <ip$ipv4|ipv6$ipv6> <nht|import-check>$type [<A.B.C.D|X:X::X:X>$addr|vrf NAME$vrf_name [<A.B.C.D|X:X::X:X>$addr]|vrf all$vrf_all]",
+ "show <ip$ipv4|ipv6$ipv6> <nht|import-check>$type [<A.B.C.D|X:X::X:X>$addr|vrf NAME$vrf_name [<A.B.C.D|X:X::X:X>$addr]|vrf all$vrf_all] [mrib$mrib]",
SHOW_STR
IP_STR
IP6_STR
@@ -1372,11 +1372,13 @@ DEFPY (show_ip_nht,
VRF_CMD_HELP_STR
"IPv4 Address\n"
"IPv6 Address\n"
- VRF_ALL_CMD_HELP_STR)
+ VRF_ALL_CMD_HELP_STR
+ "Show Multicast (MRIB) NHT state\n")
{
afi_t afi = ipv4 ? AFI_IP : AFI_IP6;
vrf_id_t vrf_id = VRF_DEFAULT;
struct prefix prefix, *p = NULL;
+ safi_t safi = mrib ? SAFI_MULTICAST : SAFI_UNICAST;
if (vrf_all) {
struct vrf *vrf;
@@ -1385,8 +1387,8 @@ DEFPY (show_ip_nht,
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
if ((zvrf = vrf->info) != NULL) {
vty_out(vty, "\nVRF %s:\n", zvrf_name(zvrf));
- zebra_print_rnh_table(zvrf_id(zvrf), afi, vty,
- NULL);
+ zebra_print_rnh_table(zvrf_id(zvrf), afi, safi,
+ vty, NULL);
}
return CMD_SUCCESS;
}
@@ -1400,7 +1402,7 @@ DEFPY (show_ip_nht,
return CMD_WARNING;
}
- zebra_print_rnh_table(vrf_id, afi, vty, p);
+ zebra_print_rnh_table(vrf_id, afi, safi, vty, p);
return CMD_SUCCESS;
}