This cli used to configure PIMV6 hello and hold timer on interface.
Signed-off-by: sarita patra <saritap@vmware.com>
return pim_process_no_ip_pim_drprio_cmd(vty);
}
+DEFPY (interface_ipv6_pim_hello,
+ interface_ipv6_pim_hello_cmd,
+ "ipv6 pim hello (1-65535) [(1-65535)]$hold",
+ IPV6_STR
+ PIM_STR
+ IFACE_PIM_HELLO_STR
+ IFACE_PIM_HELLO_TIME_STR
+ IFACE_PIM_HELLO_HOLD_STR)
+{
+ return pim_process_ip_pim_hello_cmd(vty, hello_str, hold_str);
+}
+
+DEFPY (interface_no_ipv6_pim_hello,
+ interface_no_ipv6_pim_hello_cmd,
+ "no ipv6 pim hello [(1-65535) [(1-65535)]]",
+ NO_STR
+ IPV6_STR
+ PIM_STR
+ IFACE_PIM_HELLO_STR
+ IGNORED_IN_NO_STR
+ IGNORED_IN_NO_STR)
+{
+ return pim_process_no_ip_pim_hello_cmd(vty);
+}
+
void pim_cmd_init(void)
{
if_cmd_init(pim_interface_config_write);
install_element(INTERFACE_NODE, &interface_no_ipv6_pim_cmd);
install_element(INTERFACE_NODE, &interface_ipv6_pim_drprio_cmd);
install_element(INTERFACE_NODE, &interface_no_ipv6_pim_drprio_cmd);
+ install_element(INTERFACE_NODE, &interface_ipv6_pim_hello_cmd);
+ install_element(INTERFACE_NODE, &interface_no_ipv6_pim_hello_cmd);
}
#define IFACE_MLD_LAST_MEMBER_QUERY_INTERVAL_STR \
"MLD last member query interval\n"
#define IFACE_MLD_LAST_MEMBER_QUERY_COUNT_STR "MLD last member query count\n"
+#define IFACE_PIM_HELLO_STR "Hello Interval\n"
+#define IFACE_PIM_HELLO_TIME_STR "Time in seconds for Hello Interval\n"
+#define IFACE_PIM_HELLO_HOLD_STR "Time in seconds for Hold Interval\n"
#define MROUTE_STR "IP multicast routing table\n"
#define DEBUG_MLD_STR "MLD protocol activity\n"
#define DEBUG_MLD_EVENTS_STR "MLD protocol events\n"
{
int idx_time = 3;
int idx_hold = 4;
- const struct lyd_node *igmp_enable_dnode;
-
- igmp_enable_dnode =
- yang_dnode_getf(vty->candidate_config->dnode,
- FRR_GMP_ENABLE_XPATH, VTY_CURR_XPATH,
- "frr-routing:ipv4");
- if (!igmp_enable_dnode) {
- nb_cli_enqueue_change(vty, "./pim-enable", NB_OP_MODIFY,
- "true");
- } else {
- if (!yang_dnode_get_bool(igmp_enable_dnode, "."))
- nb_cli_enqueue_change(vty, "./pim-enable", NB_OP_MODIFY,
- "true");
- }
-
- nb_cli_enqueue_change(vty, "./hello-interval", NB_OP_MODIFY,
- argv[idx_time]->arg);
if (argc == idx_hold + 1)
- nb_cli_enqueue_change(vty, "./hello-holdtime", NB_OP_MODIFY,
- argv[idx_hold]->arg);
+ return pim_process_ip_pim_hello_cmd(vty, argv[idx_time]->arg,
+ argv[idx_hold]->arg);
- return nb_cli_apply_changes(vty,
- FRR_PIM_INTERFACE_XPATH,
- "frr-routing:ipv4");
+ else
+ return pim_process_ip_pim_hello_cmd(vty, argv[idx_time]->arg,
+ NULL);
}
DEFUN (interface_no_ip_pim_hello,
IGNORED_IN_NO_STR
IGNORED_IN_NO_STR)
{
- nb_cli_enqueue_change(vty, "./hello-interval", NB_OP_DESTROY, NULL);
- nb_cli_enqueue_change(vty, "./hello-holdtime", NB_OP_DESTROY, NULL);
-
- return nb_cli_apply_changes(vty,
- FRR_PIM_INTERFACE_XPATH,
- "frr-routing:ipv4");
+ return pim_process_no_ip_pim_hello_cmd(vty);
}
DEFUN (debug_igmp,
return nb_cli_apply_changes(vty, FRR_PIM_INTERFACE_XPATH,
FRR_PIM_AF_XPATH_VAL);
}
+
+int pim_process_ip_pim_hello_cmd(struct vty *vty, const char *hello_str,
+ const char *hold_str)
+{
+ const struct lyd_node *mld_enable_dnode;
+
+ mld_enable_dnode = yang_dnode_getf(vty->candidate_config->dnode,
+ FRR_GMP_ENABLE_XPATH, VTY_CURR_XPATH,
+ FRR_PIM_AF_XPATH_VAL);
+
+ if (!mld_enable_dnode) {
+ nb_cli_enqueue_change(vty, "./pim-enable", NB_OP_MODIFY,
+ "true");
+ } else {
+ if (!yang_dnode_get_bool(mld_enable_dnode, "."))
+ nb_cli_enqueue_change(vty, "./pim-enable", NB_OP_MODIFY,
+ "true");
+ }
+
+ nb_cli_enqueue_change(vty, "./hello-interval", NB_OP_MODIFY, hello_str);
+
+ if (hold_str)
+ nb_cli_enqueue_change(vty, "./hello-holdtime", NB_OP_MODIFY,
+ hold_str);
+
+ return nb_cli_apply_changes(vty, FRR_PIM_INTERFACE_XPATH,
+ FRR_PIM_AF_XPATH_VAL);
+}
+
+int pim_process_no_ip_pim_hello_cmd(struct vty *vty)
+{
+ nb_cli_enqueue_change(vty, "./hello-interval", NB_OP_DESTROY, NULL);
+ nb_cli_enqueue_change(vty, "./hello-holdtime", NB_OP_DESTROY, NULL);
+
+ 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);
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,
+ const char *hold_str);
+int pim_process_no_ip_pim_hello_cmd(struct vty *vty);
#endif /* PIM_CMD_COMMON_H */