summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsarita patra <saritap@vmware.com>2022-04-07 09:41:14 +0200
committersarita patra <saritap@vmware.com>2022-05-13 08:50:06 +0200
commitd017bf3cb0b6616d7eac793d1b0c09112485596e (patch)
treec8bac881631bc8f31cb882901c6a9765931b9de0
parentMerge pull request #11190 from donaldsharp/bgp_data (diff)
downloadfrr-d017bf3cb0b6616d7eac793d1b0c09112485596e.tar.xz
frr-d017bf3cb0b6616d7eac793d1b0c09112485596e.zip
pimd: introduce ip pim passive command
Added a new cli command "ip pim passive" in the interface context, to disable sending of pim control packets on the interface. Signed-off-by: sarita patra <saritap@vmware.com>
-rw-r--r--pimd/pim_cmd.c50
1 files changed, 42 insertions, 8 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index 55e58f2d9..d89d1afea 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -5262,13 +5262,30 @@ DEFUN_HIDDEN (interface_ip_pim_sm,
return pim_process_ip_pim_cmd(vty);
}
-DEFUN (interface_ip_pim,
+DEFPY (interface_ip_pim,
interface_ip_pim_cmd,
- "ip pim",
+ "ip pim [passive$passive]",
IP_STR
- PIM_STR)
+ PIM_STR
+ "Disable exchange of protocol packets\n")
{
- return pim_process_ip_pim_cmd(vty);
+ VTY_DECLVAR_CONTEXT(interface, ifp);
+ struct pim_interface *pim_ifp;
+ int ret;
+
+ ret = pim_process_ip_pim_cmd(vty);
+
+ if (ret != NB_OK)
+ return ret;
+
+ pim_ifp = ifp->info;
+ if (!pim_ifp)
+ return CMD_WARNING_CONFIG_FAILED;
+
+ if (passive)
+ pim_ifp->pim_passive_enable = true;
+
+ return CMD_SUCCESS;
}
DEFUN_HIDDEN (interface_no_ip_pim_ssm,
@@ -5293,14 +5310,31 @@ DEFUN_HIDDEN (interface_no_ip_pim_sm,
return pim_process_no_ip_pim_cmd(vty);
}
-DEFUN (interface_no_ip_pim,
+DEFPY (interface_no_ip_pim,
interface_no_ip_pim_cmd,
- "no ip pim",
+ "no ip pim [passive$passive]",
NO_STR
IP_STR
- PIM_STR)
+ PIM_STR
+ "Disable exchange of protocol packets\n")
{
- return pim_process_no_ip_pim_cmd(vty);
+ int ret;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
+ struct pim_interface *pim_ifp;
+
+ ret = pim_process_no_ip_pim_cmd(vty);
+
+ if (ret != NB_OK)
+ return ret;
+
+ pim_ifp = ifp->info;
+ if (!pim_ifp)
+ return CMD_WARNING_CONFIG_FAILED;
+
+ if (passive)
+ pim_ifp->pim_passive_enable = false;
+
+ return CMD_SUCCESS;
}
/* boundaries */