"Disable exchange of protocol packets\n")
{
int ret;
- VTY_DECLVAR_CONTEXT(interface, ifp);
- struct pim_interface *pim_ifp;
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 pim_process_ip_pim_passive_cmd(vty, true);
return CMD_SUCCESS;
}
PIM_STR
"Disable exchange of protocol packets\n")
{
- 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 pim_process_ip_pim_passive_cmd(vty, false);
- return CMD_SUCCESS;
+ return pim_process_no_ip_pim_cmd(vty);
}
DEFPY (interface_ipv6_pim_drprio,
PIM_STR
"Disable exchange of protocol packets\n")
{
- 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 pim_process_ip_pim_passive_cmd(vty, true);
return CMD_SUCCESS;
}
PIM_STR
"Disable exchange of protocol packets\n")
{
- 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 pim_process_ip_pim_passive_cmd(vty, false);
- return CMD_SUCCESS;
+ return pim_process_no_ip_pim_cmd(vty);
}
/* boundaries */
FRR_PIM_AF_XPATH_VAL);
}
+int pim_process_ip_pim_passive_cmd(struct vty *vty, bool enable)
+{
+ if (enable)
+ nb_cli_enqueue_change(vty, "./pim-passive-enable", NB_OP_MODIFY,
+ "true");
+ else
+ nb_cli_enqueue_change(vty, "./pim-passive-enable", NB_OP_MODIFY,
+ "false");
+
+ return nb_cli_apply_changes(vty, FRR_PIM_INTERFACE_XPATH,
+ FRR_PIM_AF_XPATH_VAL);
+}
+
int pim_process_no_ip_pim_cmd(struct vty *vty)
{
const struct lyd_node *mld_enable_dnode;
int pim_process_ip_pim_cmd(struct vty *vty);
int pim_process_no_ip_pim_cmd(struct vty *vty);
+int pim_process_ip_pim_passive_cmd(struct vty *vty, bool enable);
int pim_process_ip_pim_drprio_cmd(struct vty *vty, const char *drpriority_str);
int pim_process_no_ip_pim_drprio_cmd(struct vty *vty);
int pim_process_ip_pim_hello_cmd(struct vty *vty, const char *hello_str,
.modify = lib_interface_pim_address_family_pim_enable_modify,
}
},
+ {
+ .xpath = "/frr-interface:lib/interface/frr-pim:pim/address-family/pim-passive-enable",
+ .cbs = {
+ .modify = lib_interface_pim_address_family_pim_passive_enable_modify,
+ }
+ },
{
.xpath = "/frr-interface:lib/interface/frr-pim:pim/address-family/dr-priority",
.cbs = {
int lib_interface_pim_address_family_destroy(struct nb_cb_destroy_args *args);
int lib_interface_pim_address_family_pim_enable_modify(
struct nb_cb_modify_args *args);
+int lib_interface_pim_address_family_pim_passive_enable_modify(
+ struct nb_cb_modify_args *args);
int lib_interface_pim_address_family_hello_interval_modify(
struct nb_cb_modify_args *args);
int lib_interface_pim_address_family_hello_holdtime_modify(
return NB_OK;
}
+/*
+ * XPath:
+ * /frr-interface:lib/interface/frr-pim:pim/address-family/pim-passive-enable
+ */
+int lib_interface_pim_address_family_pim_passive_enable_modify(
+ struct nb_cb_modify_args *args)
+{
+ struct interface *ifp;
+ struct pim_interface *pim_ifp;
+
+ switch (args->event) {
+ case NB_EV_VALIDATE:
+ case NB_EV_ABORT:
+ case NB_EV_PREPARE:
+ break;
+ case NB_EV_APPLY:
+ ifp = nb_running_get_entry(args->dnode, NULL, true);
+ pim_ifp = ifp->info;
+ pim_ifp->pim_passive_enable =
+ yang_dnode_get_bool(args->dnode, NULL);
+ break;
+ }
+
+ return NB_OK;
+}
+
/*
* XPath: /frr-interface:lib/interface/frr-pim:pim/address-family/hello-interval
*/
"Enable PIM flag on the interface.";
}
+ leaf pim-passive-enable {
+ type boolean;
+ default "false";
+ description
+ "Disable exchange of protocol packets.";
+ }
+
leaf hello-interval {
type uint8 {
range "1..max";