+// SPDX-License-Identifier: GPL-2.0-or-later
/* Zebra VTY functions
* Copyright (C) 2002 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <zebra.h>
}
-DEFUN (show_ip_rpf,
+DEFPY (show_ip_rpf,
show_ip_rpf_cmd,
- "show ip rpf [json]",
+ "show [ip$ip|ipv6$ipv6] rpf [json]",
SHOW_STR
IP_STR
+ IPV6_STR
"Display RPF information for multicast source\n"
JSON_STR)
{
.multi = false,
};
- return do_show_ip_route(vty, VRF_DEFAULT_NAME, AFI_IP, SAFI_MULTICAST,
- false, uj, 0, NULL, false, 0, 0, 0, false,
- &ctx);
+ return do_show_ip_route(vty, VRF_DEFAULT_NAME, ip ? AFI_IP : AFI_IP6,
+ SAFI_MULTICAST, false, uj, 0, NULL, false, 0, 0,
+ 0, false, &ctx);
}
DEFPY (show_ip_rpf_addr,
return CMD_SUCCESS;
}
+DEFPY (show_ipv6_rpf_addr,
+ show_ipv6_rpf_addr_cmd,
+ "show ipv6 rpf X:X::X:X$address",
+ SHOW_STR
+ IPV6_STR
+ "Display RPF information for multicast source\n"
+ "IPv6 multicast source address\n")
+{
+ struct route_node *rn;
+ struct route_entry *re;
+
+ re = rib_match_multicast(AFI_IP6, VRF_DEFAULT, (union g_addr *)&address,
+ &rn);
+
+ if (re)
+ vty_show_ip_route_detail(vty, rn, 1, false, false);
+ else
+ vty_out(vty, "%% No match for RPF lookup\n");
+
+ return CMD_SUCCESS;
+}
+
static char re_status_output_char(const struct route_entry *re,
const struct nexthop *nhop,
bool is_fib)
if (re->mtu)
vty_out(vty, ", mtu %u", re->mtu);
if (re->vrf_id != VRF_DEFAULT) {
- zvrf = vrf_info_lookup(re->vrf_id);
+ zvrf = zebra_vrf_lookup_by_id(re->vrf_id);
vty_out(vty, ", vrf %s", zvrf_name(zvrf));
}
if (CHECK_FLAG(re->flags, ZEBRA_FLAG_SELECTED))
json_object_string_add(json, "type",
zebra_route_string(nhe->type));
json_object_int_add(json, "refCount", nhe->refcnt);
- if (thread_is_scheduled(nhe->timer))
+ if (event_is_scheduled(nhe->timer))
json_object_string_add(
json, "timeToDeletion",
- thread_timer_to_hhmmss(time_left,
- sizeof(time_left),
- nhe->timer));
+ event_timer_to_hhmmss(time_left,
+ sizeof(time_left),
+ nhe->timer));
json_object_string_add(json, "uptime", up_str);
json_object_string_add(json, "vrf",
vrf_id_to_name(nhe->vrf_id));
vty_out(vty, "ID: %u (%s)\n", nhe->id,
zebra_route_string(nhe->type));
vty_out(vty, " RefCnt: %u", nhe->refcnt);
- if (thread_is_scheduled(nhe->timer))
+ if (event_is_scheduled(nhe->timer))
vty_out(vty, " Time to Deletion: %s",
- thread_timer_to_hhmmss(time_left,
- sizeof(time_left),
- nhe->timer));
+ event_timer_to_hhmmss(time_left,
+ sizeof(time_left),
+ nhe->timer));
vty_out(vty, "\n");
vty_out(vty, " Uptime: %s\n", up_str);
struct zebra_vrf *zvrf = NULL;
int filter = 0;
- zvrf = vrf_info_lookup(VRF_DEFAULT);
+ zvrf = zebra_vrf_lookup_by_id(VRF_DEFAULT);
if (!zvrf)
return CMD_WARNING;
vni_t vni = strtoul(argv[2]->arg, NULL, 10);
struct zebra_vrf *zvrf = NULL;
- zvrf = vrf_info_lookup(VRF_DEFAULT);
+ zvrf = zebra_vrf_lookup_by_id(VRF_DEFAULT);
if (!zvrf)
return CMD_WARNING;
install_element(VIEW_NODE, &show_ip_rpf_cmd);
install_element(VIEW_NODE, &show_ip_rpf_addr_cmd);
+ install_element(VIEW_NODE, &show_ipv6_rpf_addr_cmd);
install_element(CONFIG_NODE, &ip_nht_default_route_cmd);
install_element(CONFIG_NODE, &no_ip_nht_default_route_cmd);