summaryrefslogtreecommitdiff
path: root/pimd/pim_cmd.c
diff options
context:
space:
mode:
authorsaravanank <saravanank@vmware.com>2019-05-02 08:04:47 -0700
committersaravanank <saravanank@vmware.com>2019-05-14 20:23:15 -0700
commit16c926c85dc49ae7d39b4f6b2194cb08b65daf7b (patch)
tree0ae520cbbfcde9c150f621b5b0b6de5433510eef /pimd/pim_cmd.c
parent025725f70dc5a04f83e31248502582bd1cd42755 (diff)
pimd: interface commands to enable/disable bsm processing
(intf)ip pim bsm - to enable bsm processing on the interface (intf)no ip pim bsm - to disable bsm processing on the interface (intf)ip pim unicast-bsm - to enable ucast bsm processing on the interface (intf)no ip pim unicast-bsm - to disable ucast bsm processing on the interface Note: bsm processing and ucast bsm processing is enabled by default on a pim interface. The CLI is implemented as a security feature as recommended by RFC 5059 Signed-off-by: Saravanan K <saravanank@vmware.com>
Diffstat (limited to 'pimd/pim_cmd.c')
-rw-r--r--pimd/pim_cmd.c93
1 files changed, 93 insertions, 0 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index 4c9053a206..26796d14c0 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -7755,6 +7755,94 @@ DEFUN (no_ip_pim_bfd,
return CMD_SUCCESS;
}
+DEFUN (ip_pim_bsm,
+ ip_pim_bsm_cmd,
+ "ip pim bsm",
+ IP_STR
+ PIM_STR
+ "Enables BSM support on the interface\n")
+{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
+ struct pim_interface *pim_ifp = ifp->info;
+
+ if (!pim_ifp) {
+ if (!pim_cmd_interface_add(ifp)) {
+ vty_out(vty, "Could not enable PIM SM on interface\n");
+ return CMD_WARNING;
+ }
+ }
+
+ pim_ifp = ifp->info;
+ pim_ifp->bsm_enable = true;
+
+ return CMD_SUCCESS;
+}
+
+DEFUN (no_ip_pim_bsm,
+ no_ip_pim_bsm_cmd,
+ "no ip pim bsm",
+ NO_STR
+ IP_STR
+ PIM_STR
+ "Disables BSM support\n")
+{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
+ struct pim_interface *pim_ifp = ifp->info;
+
+ if (!pim_ifp) {
+ vty_out(vty, "Pim not enabled on this interface\n");
+ return CMD_WARNING;
+ }
+
+ pim_ifp->bsm_enable = false;
+
+ return CMD_SUCCESS;
+}
+
+DEFUN (ip_pim_ucast_bsm,
+ ip_pim_ucast_bsm_cmd,
+ "ip pim unicast-bsm",
+ IP_STR
+ PIM_STR
+ "Accept/Send unicast BSM on the interface\n")
+{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
+ struct pim_interface *pim_ifp = ifp->info;
+
+ if (!pim_ifp) {
+ if (!pim_cmd_interface_add(ifp)) {
+ vty_out(vty, "Could not enable PIM SM on interface\n");
+ return CMD_WARNING;
+ }
+ }
+
+ pim_ifp = ifp->info;
+ pim_ifp->ucast_bsm_accept = true;
+
+ return CMD_SUCCESS;
+}
+
+DEFUN (no_ip_pim_ucast_bsm,
+ no_ip_pim_ucast_bsm_cmd,
+ "no ip pim unicast-bsm",
+ NO_STR
+ IP_STR
+ PIM_STR
+ "Block send/receive unicast BSM on this interface\n")
+{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
+ struct pim_interface *pim_ifp = ifp->info;
+
+ if (!pim_ifp) {
+ vty_out(vty, "Pim not enabled on this interface\n");
+ return CMD_WARNING;
+ }
+
+ pim_ifp->ucast_bsm_accept = false;
+
+ return CMD_SUCCESS;
+}
+
#if HAVE_BFDD > 0
DEFUN_HIDDEN(
#else
@@ -9487,6 +9575,11 @@ void pim_cmd_init(void)
install_element(VIEW_NODE, &show_ip_pim_vxlan_sg_work_cmd);
install_element(INTERFACE_NODE, &interface_pim_use_source_cmd);
install_element(INTERFACE_NODE, &interface_no_pim_use_source_cmd);
+ /* Install BSM command */
+ install_element(INTERFACE_NODE, &ip_pim_bsm_cmd);
+ install_element(INTERFACE_NODE, &no_ip_pim_bsm_cmd);
+ install_element(INTERFACE_NODE, &ip_pim_ucast_bsm_cmd);
+ install_element(INTERFACE_NODE, &no_ip_pim_ucast_bsm_cmd);
/* Install BFD command */
install_element(INTERFACE_NODE, &ip_pim_bfd_cmd);
install_element(INTERFACE_NODE, &ip_pim_bfd_param_cmd);