diff options
| author | Sai Gomathi N <nsaigomathi@vmware.com> | 2022-06-09 04:22:42 -0700 |
|---|---|---|
| committer | Sai Gomathi N <nsaigomathi@vmware.com> | 2022-06-09 04:22:42 -0700 |
| commit | fe7eaf4065cab165d40a6010d00d5c84273a4cf0 (patch) | |
| tree | 01dafb2d4807e455594c9f83c6c5fd1ebb56e7c1 /pimd/pim6_cmd.c | |
| parent | cefa37cf41709bc23a1be296b6ed63097ea47350 (diff) | |
pim6d: Moving the common lines of pim_show_nexthop_lookup cli
Moving the common lines of pim_show_nexthop_lookup cli
in pim_cmd.c and pim6_cmd.c to pim_cmd_common.c file
Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
Diffstat (limited to 'pimd/pim6_cmd.c')
| -rw-r--r-- | pimd/pim6_cmd.c | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/pimd/pim6_cmd.c b/pimd/pim6_cmd.c index 55d77f6e96..2b13d70f51 100644 --- a/pimd/pim6_cmd.c +++ b/pimd/pim6_cmd.c @@ -1432,37 +1432,7 @@ DEFPY (show_ipv6_pim_nexthop_lookup, "Source/RP address\n" "Multicast Group address\n") { - struct prefix nht_p; - int result = 0; - pim_addr vif_source; - struct prefix grp; - struct pim_nexthop nexthop; - struct vrf *v; - - v = vrf_lookup_by_name(vrf ? vrf : VRF_DEFAULT_NAME); - - if (!v) - return CMD_WARNING; - - if (!pim_rp_set_upstream_addr(v->info, &vif_source, source, group)) - return CMD_SUCCESS; - - pim_addr_to_prefix(&nht_p, vif_source); - pim_addr_to_prefix(&grp, group); - memset(&nexthop, 0, sizeof(nexthop)); - - result = pim_ecmp_nexthop_lookup(v->info, &nexthop, &nht_p, &grp, 0); - - if (!result) { - vty_out(vty, - "Nexthop Lookup failed, no usable routes returned.\n"); - return CMD_SUCCESS; - } - - vty_out(vty, "Group %s --- Nexthop %pPAs Interface %s\n", group_str, - &nexthop.mrib_nexthop_addr, nexthop.interface->name); - - return CMD_SUCCESS; + return pim_show_nexthop_lookup_cmd_helper(vrf, vty, source, group); } DEFPY (show_ipv6_multicast, |
