diff options
Diffstat (limited to 'pimd/pim_rp.c')
-rw-r--r-- | pimd/pim_rp.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/pimd/pim_rp.c b/pimd/pim_rp.c index 00a1e1b58..99727cf83 100644 --- a/pimd/pim_rp.c +++ b/pimd/pim_rp.c @@ -49,6 +49,7 @@ #include "pim_zebra.h" #include "pim_bsm.h" #include "pim_util.h" +#include "pim_ssm.h" /* Cleanup pim->rpf_hash each node data */ void pim_rp_list_hash_clean(void *data) @@ -1145,7 +1146,8 @@ int pim_rp_config_write(struct pim_instance *pim, struct vty *vty, return count; } -void pim_rp_show_information(struct pim_instance *pim, struct vty *vty, bool uj) +void pim_rp_show_information(struct pim_instance *pim, struct prefix *range, + struct vty *vty, bool uj) { struct rp_info *rp_info; struct rp_info *prev_rp_info = NULL; @@ -1160,11 +1162,22 @@ 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 Source\n"); + "RP address group/prefix-list OIF I am RP Source Group-Type\n"); for (ALL_LIST_ELEMENTS_RO(pim->rp_list, node, rp_info)) { if (pim_rpf_addr_is_inaddr_any(&rp_info->rp)) continue; +#if PIM_IPV == 4 + pim_addr group = rp_info->group.u.prefix4; +#else + pim_addr group = rp_info->group.u.prefix6; +#endif + const char *group_type = + pim_is_grp_ssm(pim, group) ? "SSM" : "ASM"; + + if (range && !prefix_same(&rp_info->group, range)) + continue; + if (rp_info->rp_src == RP_SRC_STATIC) strlcpy(source, "Static", sizeof(source)); else if (rp_info->rp_src == RP_SRC_BSR) @@ -1214,6 +1227,8 @@ void pim_rp_show_information(struct pim_instance *pim, struct vty *vty, bool uj) "%pFX", &rp_info->group); json_object_string_add(json_row, "source", source); + json_object_string_add(json_row, "groupType", + group_type); json_object_array_add(json_rp_rows, json_row); } else { @@ -1236,7 +1251,8 @@ void pim_rp_show_information(struct pim_instance *pim, struct vty *vty, bool uj) else vty_out(vty, "no"); - vty_out(vty, "%14s\n", source); + vty_out(vty, "%14s", source); + vty_out(vty, "%6s\n", group_type); } prev_rp_info = rp_info; } |