diff options
-rw-r--r-- | pimd/pim6_cmd.c | 12 | ||||
-rw-r--r-- | pimd/pim_cmd.c | 15 | ||||
-rw-r--r-- | pimd/pim_cmd_common.c | 17 | ||||
-rw-r--r-- | pimd/pim_cmd_common.h | 1 |
4 files changed, 31 insertions, 14 deletions
diff --git a/pimd/pim6_cmd.c b/pimd/pim6_cmd.c index 330cff755..a11a877bf 100644 --- a/pimd/pim6_cmd.c +++ b/pimd/pim6_cmd.c @@ -277,6 +277,17 @@ DEFPY (interface_no_ipv6_pim_hello, return pim_process_no_ip_pim_hello_cmd(vty); } +DEFPY (interface_ipv6_pim_activeactive, + interface_ipv6_pim_activeactive_cmd, + "[no] ipv6 pim active-active", + NO_STR + IPV6_STR + PIM_STR + "Mark interface as Active-Active for MLAG operations\n") +{ + return pim_process_ip_pim_activeactive_cmd(vty, no); +} + void pim_cmd_init(void) { if_cmd_init(pim_interface_config_write); @@ -301,4 +312,5 @@ void pim_cmd_init(void) 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); + install_element(INTERFACE_NODE, &interface_ipv6_pim_activeactive_cmd); } diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 19044064f..2ea36ed9e 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -8062,20 +8062,7 @@ DEFPY (interface_ip_pim_activeactive, PIM_STR "Mark interface as Active-Active for MLAG operations, Hidden because not finished yet\n") { - if (no) - nb_cli_enqueue_change(vty, "./active-active", NB_OP_MODIFY, - "false"); - else { - nb_cli_enqueue_change(vty, "./pim-enable", NB_OP_MODIFY, - "true"); - - nb_cli_enqueue_change(vty, "./active-active", NB_OP_MODIFY, - "true"); - } - - return nb_cli_apply_changes(vty, - FRR_PIM_INTERFACE_XPATH, - "frr-routing:ipv4"); + return pim_process_ip_pim_activeactive_cmd(vty, no); } DEFUN_HIDDEN (interface_ip_pim_ssm, diff --git a/pimd/pim_cmd_common.c b/pimd/pim_cmd_common.c index 386a83754..40a59fce8 100644 --- a/pimd/pim_cmd_common.c +++ b/pimd/pim_cmd_common.c @@ -425,3 +425,20 @@ int pim_process_no_ip_pim_hello_cmd(struct vty *vty) return nb_cli_apply_changes(vty, FRR_PIM_INTERFACE_XPATH, FRR_PIM_AF_XPATH_VAL); } + +int pim_process_ip_pim_activeactive_cmd(struct vty *vty, const char *no) +{ + if (no) + nb_cli_enqueue_change(vty, "./active-active", NB_OP_MODIFY, + "false"); + else { + nb_cli_enqueue_change(vty, "./pim-enable", NB_OP_MODIFY, + "true"); + + nb_cli_enqueue_change(vty, "./active-active", NB_OP_MODIFY, + "true"); + } + + return nb_cli_apply_changes(vty, FRR_PIM_INTERFACE_XPATH, + FRR_PIM_AF_XPATH_VAL); +} diff --git a/pimd/pim_cmd_common.h b/pimd/pim_cmd_common.h index 44c70e1cb..26e771b1d 100644 --- a/pimd/pim_cmd_common.h +++ b/pimd/pim_cmd_common.h @@ -43,5 +43,6 @@ 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); +int pim_process_ip_pim_activeactive_cmd(struct vty *vty, const char *no); #endif /* PIM_CMD_COMMON_H */ |