summaryrefslogtreecommitdiffstats
path: root/pimd
diff options
context:
space:
mode:
authorsaravanank <saravanank@vmware.com>2019-05-02 10:35:35 +0200
committersaravanank <saravanank@vmware.com>2019-05-15 05:23:15 +0200
commit025725f70dc5a04f83e31248502582bd1cd42755 (patch)
tree4b767b185d72a104ec7cf42e261a2de7485bd226 /pimd
parentpimd: cli changes to show BSM statistics in show ip pim int traffic (diff)
downloadfrr-025725f70dc5a04f83e31248502582bd1cd42755.tar.xz
frr-025725f70dc5a04f83e31248502582bd1cd42755.zip
pimd: Show RP source in show ip pim rp-info command
Sw3# sh ip pim rp-info RP address group/prefix-list OIF I am RP Source 20.0.0.2 225.1.1.1/32 ens192 no BSR 9.9.9.9 226.1.1.1/32 (Unknown) no BSR 30.0.0.100 229.1.1.5/32 ens192 no Static Signed-off-by: Saravanan K <saravanank@vmware.com>
Diffstat (limited to 'pimd')
-rw-r--r--pimd/pim_rp.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/pimd/pim_rp.c b/pimd/pim_rp.c
index f01af0753..42e6805d2 100644
--- a/pimd/pim_rp.c
+++ b/pimd/pim_rp.c
@@ -1064,6 +1064,7 @@ void pim_rp_show_information(struct pim_instance *pim, struct vty *vty, bool uj)
struct rp_info *rp_info;
struct rp_info *prev_rp_info = NULL;
struct listnode *node;
+ char source[7];
json_object *json = NULL;
json_object *json_rp_rows = NULL;
@@ -1073,12 +1074,17 @@ void pim_rp_show_information(struct pim_instance *pim, struct vty *vty, bool uj)
json = json_object_new_object();
else
vty_out(vty,
- "RP address group/prefix-list OIF I am RP\n");
-
+ "RP address group/prefix-list OIF I am RP Source\n");
for (ALL_LIST_ELEMENTS_RO(pim->rp_list, node, rp_info)) {
if (!pim_rpf_addr_is_inaddr_none(&rp_info->rp)) {
char buf[48];
+ if (rp_info->rp_src == RP_SRC_STATIC)
+ strcpy(source, "Static");
+ else if (rp_info->rp_src == RP_SRC_BSR)
+ strcpy(source, "BSR");
+ else
+ strcpy(source, "None");
if (uj) {
/*
* If we have moved on to a new RP then add the
@@ -1121,6 +1127,9 @@ void pim_rp_show_information(struct pim_instance *pim, struct vty *vty, bool uj)
json_row, "group",
prefix2str(&rp_info->group, buf,
48));
+ json_object_string_add(json_row,
+ "source",
+ source);
json_object_array_add(json_rp_rows, json_row);
} else {
@@ -1145,9 +1154,10 @@ void pim_rp_show_information(struct pim_instance *pim, struct vty *vty, bool uj)
if (rp_info->i_am_rp)
vty_out(vty, "yes\n");
else
- vty_out(vty, "no\n");
- }
+ vty_out(vty, "no");
+ vty_out(vty, "%14s\n", source);
+ }
prev_rp_info = rp_info;
}
}