"PIM upstream join-desired\n"
JSON_STR)
{
- struct pim_instance *pim;
- struct vrf *v;
- bool uj = !!json;
-
- v = vrf_lookup_by_name(vrf ? vrf : VRF_DEFAULT_NAME);
-
- if (!v)
- return CMD_WARNING;
-
- pim = pim_get_pim_instance(v->vrf_id);
-
- if (!pim) {
- vty_out(vty, "%% Unable to find pim instance\n");
- return CMD_WARNING;
- }
-
- pim_show_join_desired(pim, vty, uj);
-
- return CMD_SUCCESS;
+ return pim_show_upstream_join_desired_helper(vrf, vty, !!json);
}
DEFPY (show_ipv6_pim_upstream_rpf,
"PIM upstream join-desired\n"
JSON_STR)
{
- struct pim_instance *pim;
- struct vrf *v;
- bool uj = !!json;
-
- v = vrf_lookup_by_name(vrf ? vrf : VRF_DEFAULT_NAME);
-
- if (!v)
- return CMD_WARNING;
-
- pim = pim_get_pim_instance(v->vrf_id);
-
- if (!pim) {
- vty_out(vty, "%% Unable to find pim instance\n");
- return CMD_WARNING;
- }
-
- pim_show_join_desired(pim, vty, uj);
-
- return CMD_SUCCESS;
+ return pim_show_upstream_join_desired_helper(vrf, vty, !!json);
}
DEFPY (show_ip_pim_upstream_rpf,
return CMD_SUCCESS;
}
+
+int pim_show_upstream_join_desired_helper(const char *vrf, struct vty *vty,
+ bool uj)
+{
+ struct pim_instance *pim;
+ struct vrf *v;
+
+ v = vrf_lookup_by_name(vrf ? vrf : VRF_DEFAULT_NAME);
+
+ if (!v)
+ return CMD_WARNING;
+
+ pim = pim_get_pim_instance(v->vrf_id);
+
+ if (!pim) {
+ vty_out(vty, "%% Unable to find pim instance\n");
+ return CMD_WARNING;
+ }
+
+ pim_show_join_desired(pim, vty, uj);
+
+ return CMD_SUCCESS;
+}
int pim_show_upstream_helper(const char *vrf, struct vty *vty, pim_addr s_or_g,
pim_addr g, bool json);
int pim_show_upstream_vrf_all_helper(struct vty *vty, bool json);
+int pim_show_upstream_join_desired_helper(const char *vrf, struct vty *vty,
+ bool uj);
/*
* Special Macro to allow us to get the correct pim_instance;