mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 05:27:47 +00:00
ospf6d: add support for BFD profiles
Allow user to pre configure BFD sessions using profiles. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
parent
4a9e802c3c
commit
1f7be0d242
@ -164,18 +164,22 @@ void ospf6_bfd_write_config(struct vty *vty, struct ospf6_interface *oi)
|
|||||||
else
|
else
|
||||||
#endif /* ! HAVE_BFDD */
|
#endif /* ! HAVE_BFDD */
|
||||||
vty_out(vty, " ipv6 ospf6 bfd\n");
|
vty_out(vty, " ipv6 ospf6 bfd\n");
|
||||||
|
|
||||||
|
if (oi->bfd_config.profile)
|
||||||
|
vty_out(vty, " ipv6 ospf6 bfd profile %s\n",
|
||||||
|
oi->bfd_config.profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFUN (ipv6_ospf6_bfd,
|
DEFUN(ipv6_ospf6_bfd, ipv6_ospf6_bfd_cmd,
|
||||||
ipv6_ospf6_bfd_cmd,
|
"ipv6 ospf6 bfd [profile BFDPROF]",
|
||||||
"ipv6 ospf6 bfd",
|
IP6_STR OSPF6_STR
|
||||||
IP6_STR
|
"Enables BFD support\n"
|
||||||
OSPF6_STR
|
"BFD Profile selection\n"
|
||||||
"Enables BFD support\n"
|
"BFD Profile name\n")
|
||||||
)
|
|
||||||
{
|
{
|
||||||
VTY_DECLVAR_CONTEXT(interface, ifp);
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
||||||
struct ospf6_interface *oi;
|
struct ospf6_interface *oi;
|
||||||
|
int prof_idx = 4;
|
||||||
assert(ifp);
|
assert(ifp);
|
||||||
|
|
||||||
oi = (struct ospf6_interface *)ifp->info;
|
oi = (struct ospf6_interface *)ifp->info;
|
||||||
@ -187,12 +191,44 @@ DEFUN (ipv6_ospf6_bfd,
|
|||||||
oi->bfd_config.min_rx = BFD_DEF_MIN_RX;
|
oi->bfd_config.min_rx = BFD_DEF_MIN_RX;
|
||||||
oi->bfd_config.min_tx = BFD_DEF_MIN_TX;
|
oi->bfd_config.min_tx = BFD_DEF_MIN_TX;
|
||||||
oi->bfd_config.enabled = true;
|
oi->bfd_config.enabled = true;
|
||||||
|
if (argc > prof_idx) {
|
||||||
|
XFREE(MTYPE_TMP, oi->bfd_config.profile);
|
||||||
|
oi->bfd_config.profile =
|
||||||
|
XSTRDUP(MTYPE_TMP, argv[prof_idx]->arg);
|
||||||
|
}
|
||||||
|
|
||||||
ospf6_bfd_reg_dereg_all_nbr(oi, true);
|
ospf6_bfd_reg_dereg_all_nbr(oi, true);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFUN(no_ipv6_ospf6_bfd_profile, no_ipv6_ospf6_bfd_profile_cmd,
|
||||||
|
"no ipv6 ospf6 bfd profile [BFDPROF]",
|
||||||
|
NO_STR IP6_STR OSPF6_STR
|
||||||
|
"BFD support\n"
|
||||||
|
"BFD Profile selection\n"
|
||||||
|
"BFD Profile name\n")
|
||||||
|
{
|
||||||
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
||||||
|
struct ospf6_interface *oi;
|
||||||
|
assert(ifp);
|
||||||
|
|
||||||
|
oi = (struct ospf6_interface *)ifp->info;
|
||||||
|
if (oi == NULL)
|
||||||
|
oi = ospf6_interface_create(ifp);
|
||||||
|
assert(oi);
|
||||||
|
|
||||||
|
/* BFD not enabled, nothing to do. */
|
||||||
|
if (!oi->bfd_config.enabled)
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
|
||||||
|
/* Remove profile and apply new configuration. */
|
||||||
|
XFREE(MTYPE_TMP, oi->bfd_config.profile);
|
||||||
|
ospf6_bfd_reg_dereg_all_nbr(oi, true);
|
||||||
|
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
#if HAVE_BFDD > 0
|
#if HAVE_BFDD > 0
|
||||||
DEFUN_HIDDEN(
|
DEFUN_HIDDEN(
|
||||||
#else
|
#else
|
||||||
@ -263,5 +299,6 @@ void ospf6_bfd_init(void)
|
|||||||
/* Install BFD command */
|
/* Install BFD command */
|
||||||
install_element(INTERFACE_NODE, &ipv6_ospf6_bfd_cmd);
|
install_element(INTERFACE_NODE, &ipv6_ospf6_bfd_cmd);
|
||||||
install_element(INTERFACE_NODE, &ipv6_ospf6_bfd_param_cmd);
|
install_element(INTERFACE_NODE, &ipv6_ospf6_bfd_param_cmd);
|
||||||
|
install_element(INTERFACE_NODE, &no_ipv6_ospf6_bfd_profile_cmd);
|
||||||
install_element(INTERFACE_NODE, &no_ipv6_ospf6_bfd_cmd);
|
install_element(INTERFACE_NODE, &no_ipv6_ospf6_bfd_cmd);
|
||||||
}
|
}
|
||||||
|
@ -275,6 +275,9 @@ void ospf6_interface_delete(struct ospf6_interface *oi)
|
|||||||
/* disable from area list if possible */
|
/* disable from area list if possible */
|
||||||
ospf6_area_interface_delete(oi);
|
ospf6_area_interface_delete(oi);
|
||||||
|
|
||||||
|
/* Free BFD allocated data. */
|
||||||
|
XFREE(MTYPE_TMP, oi->bfd_config.profile);
|
||||||
|
|
||||||
XFREE(MTYPE_OSPF6_IF, oi);
|
XFREE(MTYPE_OSPF6_IF, oi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,6 +124,7 @@ struct ospf6_interface {
|
|||||||
uint8_t detection_multiplier;
|
uint8_t detection_multiplier;
|
||||||
uint32_t min_rx;
|
uint32_t min_rx;
|
||||||
uint32_t min_tx;
|
uint32_t min_tx;
|
||||||
|
char *profile;
|
||||||
} bfd_config;
|
} bfd_config;
|
||||||
|
|
||||||
/* Statistics Fields */
|
/* Statistics Fields */
|
||||||
|
Loading…
Reference in New Issue
Block a user