Skip to content

Commit

Permalink
pim6d: BSM CLIs implementation PR 11600
Browse files Browse the repository at this point in the history
  • Loading branch information
mobash-rasool committed Sep 20, 2022
1 parent e09ce4b commit 04511c1
Show file tree
Hide file tree
Showing 6 changed files with 629 additions and 434 deletions.
28 changes: 28 additions & 0 deletions doc/user/pimv6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,18 @@ is in a vrf, enter the interface command with the vrf keyword at the end.

Disable sending and receiving pim control packets on the interface.

.. clicmd:: ipv6 pim bsm

Tell pim that we would like to use this interface to process bootstrap
messages. This is enabled by default. 'no' form of this command is used to
restrict bsm messages on this interface.

.. clicmd:: ipv6 pim unicast-bsm

Tell pim that we would like to allow interface to process unicast bootstrap
messages. This is enabled by default. 'no' form of this command is used to
restrict processing of unicast bsm messages on this interface.

.. clicmd:: ipv6 mld

Tell pim to receive MLD reports and Query on this interface. The default
Expand Down Expand Up @@ -373,6 +385,18 @@ General multicast routing state
Display total number of S,G mroutes and number of S,G mroutes
installed into the kernel for all vrfs.

.. clicmd:: show ipv6 pim bsr

Display current bsr, its uptime and last received bsm age.

.. clicmd:: show ipv6 pim bsrp-info

Display group-to-rp mappings received from E-BSR.

.. clicmd:: show ipv6 pim bsm-database

Display all fragments ofstored bootstrap message in user readable format.

PIMv6 Clear Commands
====================

Expand Down Expand Up @@ -456,3 +480,7 @@ the config was written out.
.. clicmd:: debug mroute6 detail

This turns on detailed debugging for PIMv6 interaction with kernel MFC cache.

.. clicmd:: debug pimv6 bsm

This turns on debugging for BSR message processing.
105 changes: 104 additions & 1 deletion pimd/pim6_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,47 @@ DEFPY (no_ipv6_pim_rp_prefix_list,
return pim_process_no_rp_plist_cmd(vty, rp_str, plist);
}

DEFPY (ipv6_pim_bsm,
ipv6_pim_bsm_cmd,
"ipv6 pim bsm",
IPV6_STR
PIM_STR
"Enables BSM support on the interface\n")
{
return pim_process_bsm_cmd(vty);
}

DEFPY (no_ipv6_pim_bsm,
no_ipv6_pim_bsm_cmd,
"no ipv6 pim bsm",
NO_STR
IPV6_STR
PIM_STR
"Disables BSM support\n")
{
return pim_process_no_bsm_cmd(vty);
}

DEFPY (ipv6_pim_ucast_bsm,
ipv6_pim_ucast_bsm_cmd,
"ipv6 pim unicast-bsm",
IPV6_STR
PIM_STR
"Accept/Send unicast BSM on the interface\n")
{
return pim_process_unicast_bsm_cmd(vty);
}

DEFPY (no_ipv6_pim_ucast_bsm,
no_ipv6_pim_ucast_bsm_cmd,
"no ipv6 pim unicast-bsm",
NO_STR
IPV6_STR
PIM_STR
"Block send/receive unicast BSM on this interface\n")
{
return pim_process_no_unicast_bsm_cmd(vty);
}

DEFPY (ipv6_ssmpingd,
ipv6_ssmpingd_cmd,
Expand Down Expand Up @@ -1240,6 +1281,44 @@ DEFPY (show_ipv6_pim_interface_traffic,
return pim_show_interface_traffic_helper(vrf, if_name, vty, !!json);
}

DEFPY (show_ipv6_pim_bsr,
show_ipv6_pim_bsr_cmd,
"show ipv6 pim bsr [vrf NAME] [json$json]",
SHOW_STR
IPV6_STR
PIM_STR
"boot-strap router information\n"
VRF_CMD_HELP_STR
JSON_STR)
{
return pim_show_bsr_helper(vrf, vty, !!json);
}

DEFPY (show_ipv6_pim_bsm_db,
show_ipv6_pim_bsm_db_cmd,
"show ipv6 pim bsm-database [vrf NAME] [json$json]",
SHOW_STR
IPV6_STR
PIM_STR
"PIM cached bsm packets information\n"
VRF_CMD_HELP_STR
JSON_STR)
{
return pim_show_bsm_db_helper(vrf, vty, !!json);
}

DEFPY (show_ipv6_pim_bsrp,
show_ipv6_pim_bsrp_cmd,
"show ipv6 pim bsrp-info [vrf NAME] [json$json]",
SHOW_STR
IPV6_STR
PIM_STR
"PIM cached group-rp mappings information\n"
VRF_CMD_HELP_STR
JSON_STR)
{
return pim_show_group_rp_mappings_info_helper(vrf, vty, !!json);
}

DEFPY (clear_ipv6_pim_statistics,
clear_ipv6_pim_statistics_cmd,
Expand Down Expand Up @@ -1561,6 +1640,22 @@ DEFUN_NOSH (show_debugging_pimv6,
return CMD_SUCCESS;
}

DEFPY (debug_pimv6_bsm,
debug_pimv6_bsm_cmd,
"[no] debug pimv6 bsm",
NO_STR
DEBUG_STR
DEBUG_PIMV6_STR
DEBUG_PIMV6_BSM_STR)
{
if (!no)
PIM_DO_DEBUG_BSM;
else
PIM_DONT_DEBUG_BSM;

return CMD_SUCCESS;
}

void pim_cmd_init(void)
{
if_cmd_init(pim_interface_config_write);
Expand Down Expand Up @@ -1598,6 +1693,11 @@ void pim_cmd_init(void)
&interface_no_ipv6_pim_boundary_oil_cmd);
install_element(INTERFACE_NODE, &interface_ipv6_mroute_cmd);
install_element(INTERFACE_NODE, &interface_no_ipv6_mroute_cmd);
/* Install BSM command */
install_element(INTERFACE_NODE, &ipv6_pim_bsm_cmd);
install_element(INTERFACE_NODE, &no_ipv6_pim_bsm_cmd);
install_element(INTERFACE_NODE, &ipv6_pim_ucast_bsm_cmd);
install_element(INTERFACE_NODE, &no_ipv6_pim_ucast_bsm_cmd);
install_element(CONFIG_NODE, &ipv6_pim_rp_cmd);
install_element(VRF_NODE, &ipv6_pim_rp_cmd);
install_element(CONFIG_NODE, &no_ipv6_pim_rp_cmd);
Expand Down Expand Up @@ -1670,7 +1770,8 @@ void pim_cmd_init(void)
install_element(VIEW_NODE, &show_ipv6_mroute_summary_cmd);
install_element(VIEW_NODE, &show_ipv6_mroute_summary_vrf_all_cmd);
install_element(VIEW_NODE, &show_ipv6_pim_interface_traffic_cmd);

install_element(VIEW_NODE, &show_ipv6_pim_bsr_cmd);
install_element(VIEW_NODE, &show_ipv6_pim_bsm_db_cmd);
install_element(ENABLE_NODE, &clear_ipv6_pim_statistics_cmd);
install_element(ENABLE_NODE, &clear_ipv6_mroute_cmd);
install_element(ENABLE_NODE, &clear_ipv6_pim_oil_cmd);
Expand All @@ -1693,6 +1794,7 @@ void pim_cmd_init(void)
install_element(ENABLE_NODE, &debug_pimv6_zebra_cmd);
install_element(ENABLE_NODE, &debug_mroute6_cmd);
install_element(ENABLE_NODE, &debug_mroute6_detail_cmd);
install_element(ENABLE_NODE, &debug_pimv6_bsm_cmd);

install_element(CONFIG_NODE, &debug_pimv6_cmd);
install_element(CONFIG_NODE, &debug_pimv6_nht_cmd);
Expand All @@ -1706,4 +1808,5 @@ void pim_cmd_init(void)
install_element(CONFIG_NODE, &debug_pimv6_zebra_cmd);
install_element(CONFIG_NODE, &debug_mroute6_cmd);
install_element(CONFIG_NODE, &debug_mroute6_detail_cmd);
install_element(CONFIG_NODE, &debug_pimv6_bsm_cmd);
}
1 change: 1 addition & 0 deletions pimd/pim6_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#define DEBUG_PIMV6_TRACE_STR "PIMv6 internal daemon activity\n"
#define DEBUG_PIMV6_ZEBRA_STR "ZEBRA protocol activity\n"
#define DEBUG_MROUTE6_STR "PIMv6 interaction with kernel MFC cache\n"
#define DEBUG_PIMV6_BSM_STR "BSR message processing activity\n"

void pim_cmd_init(void);

Expand Down
Loading

0 comments on commit 04511c1

Please sign in to comment.