summaryrefslogtreecommitdiffstats
path: root/pimd
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2022-07-13 16:54:39 +0200
committerGitHub <noreply@github.com>2022-07-13 16:54:39 +0200
commit1004137bf3ac8c71fdddba6c1a4dc1f37646ac40 (patch)
tree3c9cfe531630c2d79e58f5be34e431cbf83e8cd2 /pimd
parentMerge pull request #11585 from patrasar/sg_str (diff)
parentpimd: Remove pim_get_pim_instance defination in pim_cmd_common.h (diff)
downloadfrr-1004137bf3ac8c71fdddba6c1a4dc1f37646ac40.tar.xz
frr-1004137bf3ac8c71fdddba6c1a4dc1f37646ac40.zip
Merge pull request #11598 from patrasar/pim_get_instance
Diffstat (limited to 'pimd')
-rw-r--r--pimd/pim_cmd.c19
-rw-r--r--pimd/pim_cmd_common.c32
-rw-r--r--pimd/pim_cmd_common.h3
3 files changed, 23 insertions, 31 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index 843b24efd..f62b90a9d 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -4162,26 +4162,21 @@ DEFPY_HIDDEN (pim_test_sg_keepalive,
"The Group we are resetting\n")
{
struct pim_upstream *up;
+ struct vrf *vrf;
struct pim_instance *pim;
pim_sgaddr sg;
sg.src = source;
sg.grp = group;
- if (!name)
- pim = pim_get_pim_instance(VRF_DEFAULT);
- else {
- struct vrf *vrf = vrf_lookup_by_name(name);
-
- if (!vrf) {
- vty_out(vty, "%% Vrf specified: %s does not exist\n",
- name);
- return CMD_WARNING;
- }
-
- pim = pim_get_pim_instance(vrf->vrf_id);
+ vrf = vrf_lookup_by_name(name ? name : VRF_DEFAULT_NAME);
+ if (!vrf) {
+ vty_out(vty, "%% Vrf specified: %s does not exist\n", name);
+ return CMD_WARNING;
}
+ pim = vrf->info;
+
if (!pim) {
vty_out(vty, "%% Unable to find pim instance\n");
return CMD_WARNING;
diff --git a/pimd/pim_cmd_common.c b/pimd/pim_cmd_common.c
index c30017fc1..f2974edae 100644
--- a/pimd/pim_cmd_common.c
+++ b/pimd/pim_cmd_common.c
@@ -1672,7 +1672,7 @@ int pim_show_join_cmd_helper(const char *vrf, struct vty *vty, pim_addr s_or_g,
vty_out(vty, "%% Vrf specified: %s does not exist\n", vrf);
return CMD_WARNING;
}
- pim = pim_get_pim_instance(v->vrf_id);
+ pim = v->info;
if (!pim) {
vty_out(vty, "%% Unable to find pim instance\n");
@@ -1773,7 +1773,7 @@ int pim_show_jp_agg_list_cmd_helper(const char *vrf, struct vty *vty)
vty_out(vty, "%% Vrf specified: %s does not exist\n", vrf);
return CMD_WARNING;
}
- pim = pim_get_pim_instance(v->vrf_id);
+ pim = v->info;
if (!pim) {
vty_out(vty, "%% Unable to find pim instance\n");
@@ -4098,7 +4098,7 @@ int pim_show_rpf_helper(const char *vrf, struct vty *vty, bool json)
if (!v)
return CMD_WARNING;
- pim = pim_get_pim_instance(v->vrf_id);
+ pim = v->info;
if (!pim) {
vty_out(vty, "%% Unable to find pim instance\n");
@@ -4154,7 +4154,7 @@ int pim_show_rp_helper(const char *vrf, struct vty *vty, const char *group_str,
if (!v)
return CMD_WARNING;
- pim = pim_get_pim_instance(v->vrf_id);
+ pim = v->info;
if (!pim) {
vty_out(vty, "%% Unable to find pim instance\n");
@@ -4225,7 +4225,7 @@ int pim_show_secondary_helper(const char *vrf, struct vty *vty)
if (!v)
return CMD_WARNING;
- pim = pim_get_pim_instance(v->vrf_id);
+ pim = v->info;
if (!pim) {
vty_out(vty, "%% Unable to find pim instance\n");
@@ -4248,7 +4248,7 @@ int pim_show_statistics_helper(const char *vrf, struct vty *vty,
if (!v)
return CMD_WARNING;
- pim = pim_get_pim_instance(v->vrf_id);
+ pim = v->info;
if (!pim) {
vty_out(vty, "%% Unable to find pim instance\n");
@@ -4277,7 +4277,7 @@ int pim_show_upstream_helper(const char *vrf, struct vty *vty, pim_addr s_or_g,
vty_out(vty, "%% Vrf specified: %s does not exist\n", vrf);
return CMD_WARNING;
}
- pim = pim_get_pim_instance(v->vrf_id);
+ pim = v->info;
if (!pim) {
vty_out(vty, "%% Unable to find pim instance\n");
@@ -4341,7 +4341,7 @@ int pim_show_upstream_join_desired_helper(const char *vrf, struct vty *vty,
if (!v)
return CMD_WARNING;
- pim = pim_get_pim_instance(v->vrf_id);
+ pim = v->info;
if (!pim) {
vty_out(vty, "%% Unable to find pim instance\n");
@@ -4363,7 +4363,7 @@ int pim_show_upstream_rpf_helper(const char *vrf, struct vty *vty, bool uj)
if (!v)
return CMD_WARNING;
- pim = pim_get_pim_instance(v->vrf_id);
+ pim = v->info;
if (!pim) {
vty_out(vty, "%% Unable to find pim instance\n");
@@ -4387,7 +4387,7 @@ int pim_show_state_helper(const char *vrf, struct vty *vty,
if (!v)
return CMD_WARNING;
- pim = pim_get_pim_instance(v->vrf_id);
+ pim = v->info;
if (!pim) {
vty_out(vty, "%% Unable to find pim instance\n");
@@ -4441,7 +4441,7 @@ int pim_show_multicast_helper(const char *vrf, struct vty *vty)
if (!v)
return CMD_WARNING;
- pim = pim_get_pim_instance(v->vrf_id);
+ pim = v->info;
if (!pim) {
vty_out(vty, "%% Unable to find pim instance\n");
@@ -4476,7 +4476,7 @@ int pim_show_multicast_count_helper(const char *vrf, struct vty *vty, bool json)
if (!v)
return CMD_WARNING;
- pim = pim_get_pim_instance(v->vrf_id);
+ pim = v->info;
if (!pim) {
vty_out(vty, "%% Unable to find pim instance\n");
@@ -4533,7 +4533,7 @@ int pim_show_mroute_helper(const char *vrf, struct vty *vty, pim_addr s_or_g,
if (!v)
return CMD_WARNING;
- pim = pim_get_pim_instance(v->vrf_id);
+ pim = v->info;
if (!pim) {
vty_out(vty, "%% Unable to find pim instance\n");
@@ -4596,7 +4596,7 @@ int pim_show_mroute_count_helper(const char *vrf, struct vty *vty, bool json)
if (!v)
return CMD_WARNING;
- pim = pim_get_pim_instance(v->vrf_id);
+ pim = v->info;
if (!pim) {
vty_out(vty, "%% Unable to find pim instance\n");
@@ -4652,7 +4652,7 @@ int pim_show_mroute_summary_helper(const char *vrf, struct vty *vty, bool json)
if (!v)
return CMD_WARNING;
- pim = pim_get_pim_instance(v->vrf_id);
+ pim = v->info;
if (!pim) {
vty_out(vty, "%% Unable to find pim instance\n");
@@ -4888,7 +4888,7 @@ int pim_show_interface_traffic_helper(const char *vrf, const char *if_name,
if (!v)
return CMD_WARNING;
- pim = pim_get_pim_instance(v->vrf_id);
+ pim = v->info;
if (!pim) {
vty_out(vty, "%% Unable to find pim instance\n");
diff --git a/pimd/pim_cmd_common.h b/pimd/pim_cmd_common.h
index 2cb031993..1e770e6c8 100644
--- a/pimd/pim_cmd_common.h
+++ b/pimd/pim_cmd_common.h
@@ -23,9 +23,6 @@
struct pim_upstream;
struct pim_instance;
-/* duplicated from pim_instance.h - needed to avoid dependency mess */
-struct pim_instance *pim_get_pim_instance(vrf_id_t vrf_id);
-
const char *pim_cli_get_vrf_name(struct vty *vty);
int pim_process_join_prune_cmd(struct vty *vty, const char *jpi_str);
int pim_process_no_join_prune_cmd(struct vty *vty);