Skip to content

Commit

Permalink
pimd: Candidate-BSR support
Browse files Browse the repository at this point in the history
Signed-off-by: David Lamparter <[email protected]>
Signed-off-by: Jafar Al-Gharaibeh <[email protected]>
  • Loading branch information
Jafaral committed Sep 9, 2024
1 parent a110bb7 commit 2d08123
Show file tree
Hide file tree
Showing 19 changed files with 1,650 additions and 86 deletions.
69 changes: 69 additions & 0 deletions pimd/pim6_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,27 @@ DEFPY (no_ipv6_pim_ucast_bsm,
return pim_process_no_unicast_bsm_cmd(vty);
}

DEFPY (pim6_bsr_candidate_bsr,
pim6_bsr_candidate_bsr_cmd,
"[no] bsr candidate-bsr [{priority (0-255)|source <address X:X::X:X|interface IFNAME|loopback$loopback|any$any>}]",
NO_STR
BSR_STR
"Make this router a Candidate BSR\n"
"BSR Priority (higher wins)\n"
"BSR Priority (higher wins)\n"
"Specify IP address for BSR operation\n"
"Local address to use\n"
"Local address to use\n"
"Interface to pick address from\n"
"Interface to pick address from\n"
"Pick highest loopback address (default)\n"
"Pick highest address from any interface\n")
{
return pim_process_bsr_candidate_cmd(vty, FRR_PIM_CAND_BSR_XPATH, no,
false, any, ifname, address_str,
priority_str, NULL);
}

DEFPY (pim6_bsr_candidate_rp,
pim6_bsr_candidate_rp_cmd,
"[no] bsr candidate-rp [{priority (0-255)|interval (1-4294967295)|source <address X:X::X:X|interface IFNAME|loopback$loopback|any$any>}]",
Expand Down Expand Up @@ -1809,6 +1830,51 @@ DEFPY (show_ipv6_pim_cand_rp,
return CMD_SUCCESS;
}

DEFPY (show_ipv6_pim_bsr_rpdb,
show_ipv6_pim_bsr_rpdb_cmd,
"show ipv6 pim bsr candidate-rps [vrf VRF_NAME] [json$uj]",
SHOW_STR
IPV6_STR
PIM_STR
"boot-strap router information\n"
"Candidate RPs\n"
VRF_CMD_HELP_STR
JSON_STR)
{
struct vrf *vrf = pim_cmd_lookup(vty, vrf_name);

if (!vrf || !vrf->info)
return CMD_WARNING;

struct pim_instance *pim = vrf->info;
struct bsm_scope *scope = &pim->global_scope;

return pim_crp_db_show(vty, scope);
}

DEFPY (show_ipv6_pim_bsr_groups,
show_ipv6_pim_bsr_groups_cmd,
"show ipv6 pim bsr groups [vrf VRF_NAME] [json$uj]",
SHOW_STR
IPV6_STR
PIM_STR
"boot-strap router information\n"
"Candidate RP groups\n"
VRF_CMD_HELP_STR
JSON_STR)
{
struct vrf *vrf = pim_cmd_lookup(vty, vrf_name);

if (!vrf || !vrf->info)
return CMD_WARNING;

struct pim_instance *pim = vrf->info;
struct bsm_scope *scope = &pim->global_scope;

return pim_crp_groups_show(vty, scope);
}


DEFPY (show_ipv6_pim_statistics,
show_ipv6_pim_statistics_cmd,
"show ipv6 pim [vrf NAME] statistics [interface WORD$word] [json$json]",
Expand Down Expand Up @@ -2742,6 +2808,7 @@ void pim_cmd_init(void)
install_element(PIM6_NODE, &no_pim6_ssmpingd_cmd);
install_element(PIM6_NODE, &pim6_bsr_candidate_rp_cmd);
install_element(PIM6_NODE, &pim6_bsr_candidate_rp_group_cmd);
install_element(PIM6_NODE, &pim6_bsr_candidate_bsr_cmd);

install_element(CONFIG_NODE, &ipv6_mld_group_watermark_cmd);
install_element(VRF_NODE, &ipv6_mld_group_watermark_cmd);
Expand Down Expand Up @@ -2798,6 +2865,8 @@ void pim_cmd_init(void)
install_element(VIEW_NODE, &show_ipv6_pim_rpf_vrf_all_cmd);
install_element(VIEW_NODE, &show_ipv6_pim_secondary_cmd);
install_element(VIEW_NODE, &show_ipv6_pim_cand_rp_cmd);
install_element(VIEW_NODE, &show_ipv6_pim_bsr_rpdb_cmd);
install_element(VIEW_NODE, &show_ipv6_pim_bsr_groups_cmd);
install_element(VIEW_NODE, &show_ipv6_pim_statistics_cmd);
install_element(VIEW_NODE, &show_ipv6_pim_upstream_cmd);
install_element(VIEW_NODE, &show_ipv6_pim_upstream_vrf_all_cmd);
Expand Down
Loading

0 comments on commit 2d08123

Please sign in to comment.