bgpd/ospf(6)d/pimd: hide BFD commands with timers

Don't show BFD commands with timers since it might confuse users
("show running-config" won't display timers in client daemons anymore),
but keep accepting this command from previous configurations.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
Rafael Zalamena 2018-08-01 15:24:52 -03:00
parent 43adc702e1
commit 64dc4b2d7a
4 changed files with 44 additions and 6 deletions

View File

@ -560,7 +560,12 @@ DEFUN (neighbor_bfd,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
DEFUN (neighbor_bfd_param, #if HAVE_BFDD > 0
DEFUN_HIDDEN(
#else
DEFUN(
#endif /* HAVE_BFDD */
neighbor_bfd_param,
neighbor_bfd_param_cmd, neighbor_bfd_param_cmd,
"neighbor <A.B.C.D|X:X::X:X|WORD> bfd (2-255) (50-60000) (50-60000)", "neighbor <A.B.C.D|X:X::X:X|WORD> bfd (2-255) (50-60000) (50-60000)",
NEIGHBOR_STR NEIGHBOR_STR
@ -632,14 +637,21 @@ DEFUN_HIDDEN (neighbor_bfd_type,
DEFUN (no_neighbor_bfd, DEFUN (no_neighbor_bfd,
no_neighbor_bfd_cmd, no_neighbor_bfd_cmd,
#if HAVE_BFDD > 0
"no neighbor <A.B.C.D|X:X::X:X|WORD> bfd",
#else
"no neighbor <A.B.C.D|X:X::X:X|WORD> bfd [(2-255) (50-60000) (50-60000)]", "no neighbor <A.B.C.D|X:X::X:X|WORD> bfd [(2-255) (50-60000) (50-60000)]",
#endif /* HAVE_BFDD */
NO_STR NO_STR
NEIGHBOR_STR NEIGHBOR_STR
NEIGHBOR_ADDR_STR2 NEIGHBOR_ADDR_STR2
"Disables BFD support\n" "Disables BFD support\n"
#if HAVE_BFDD == 0
"Detect Multiplier\n" "Detect Multiplier\n"
"Required min receive interval\n" "Required min receive interval\n"
"Desired min transmit interval\n") "Desired min transmit interval\n"
#endif /* !HAVE_BFDD */
)
{ {
int idx_peer = 2; int idx_peer = 2;
struct peer *peer; struct peer *peer;

View File

@ -333,7 +333,12 @@ DEFUN (ipv6_ospf6_bfd,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
DEFUN (ipv6_ospf6_bfd_param, #if HAVE_BFDD > 0
DEFUN_HIDDEN(
#else
DEFUN(
#endif /* HAVE_BFDD */
ipv6_ospf6_bfd_param,
ipv6_ospf6_bfd_param_cmd, ipv6_ospf6_bfd_param_cmd,
"ipv6 ospf6 bfd (2-255) (50-60000) (50-60000)", "ipv6 ospf6 bfd (2-255) (50-60000) (50-60000)",
IP6_STR IP6_STR

View File

@ -377,7 +377,12 @@ DEFUN (ip_ospf_bfd,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
DEFUN (ip_ospf_bfd_param, #if HAVE_BFDD > 0
DEFUN_HIDDEN(
#else
DEFUN(
#endif /* HAVE_BFDD */
ip_ospf_bfd_param,
ip_ospf_bfd_param_cmd, ip_ospf_bfd_param_cmd,
"ip ospf bfd (2-255) (50-60000) (50-60000)", "ip ospf bfd (2-255) (50-60000) (50-60000)",
"IP Information\n" "IP Information\n"
@ -411,14 +416,21 @@ DEFUN (ip_ospf_bfd_param,
DEFUN (no_ip_ospf_bfd, DEFUN (no_ip_ospf_bfd,
no_ip_ospf_bfd_cmd, no_ip_ospf_bfd_cmd,
#if HAVE_BFDD > 0
"no ip ospf bfd",
#else
"no ip ospf bfd [(2-255) (50-60000) (50-60000)]", "no ip ospf bfd [(2-255) (50-60000) (50-60000)]",
#endif /* HAVE_BFDD */
NO_STR NO_STR
"IP Information\n" "IP Information\n"
"OSPF interface commands\n" "OSPF interface commands\n"
"Disables BFD support\n" "Disables BFD support\n"
#if HAVE_BFDD == 0
"Detect Multiplier\n" "Detect Multiplier\n"
"Required min receive interval\n" "Required min receive interval\n"
"Desired min transmit interval\n") "Desired min transmit interval\n"
#endif /* !HAVE_BFDD */
)
{ {
VTY_DECLVAR_CONTEXT(interface, ifp); VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf_if_params *params; struct ospf_if_params *params;

View File

@ -7547,7 +7547,12 @@ DEFUN (no_ip_pim_bfd,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
DEFUN (ip_pim_bfd_param, #if HAVE_BFDD > 0
DEFUN_HIDDEN(
#else
DEFUN(
#endif /* HAVE_BFDD */
ip_pim_bfd_param,
ip_pim_bfd_param_cmd, ip_pim_bfd_param_cmd,
"ip pim bfd (2-255) (50-60000) (50-60000)", "ip pim bfd (2-255) (50-60000) (50-60000)",
IP_STR IP_STR
@ -7585,12 +7590,14 @@ DEFUN (ip_pim_bfd_param,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
#if HAVE_BFDD == 0
ALIAS(no_ip_pim_bfd, no_ip_pim_bfd_param_cmd, ALIAS(no_ip_pim_bfd, no_ip_pim_bfd_param_cmd,
"no ip pim bfd (2-255) (50-60000) (50-60000)", NO_STR IP_STR PIM_STR "no ip pim bfd (2-255) (50-60000) (50-60000)", NO_STR IP_STR PIM_STR
"Enables BFD support\n" "Enables BFD support\n"
"Detect Multiplier\n" "Detect Multiplier\n"
"Required min receive interval\n" "Required min receive interval\n"
"Desired min transmit interval\n") "Desired min transmit interval\n")
#endif /* !HAVE_BFDD */
static int ip_msdp_peer_cmd_worker(struct pim_instance *pim, struct vty *vty, static int ip_msdp_peer_cmd_worker(struct pim_instance *pim, struct vty *vty,
const char *peer, const char *local) const char *peer, const char *local)
@ -8906,5 +8913,7 @@ void pim_cmd_init(void)
install_element(INTERFACE_NODE, &ip_pim_bfd_cmd); install_element(INTERFACE_NODE, &ip_pim_bfd_cmd);
install_element(INTERFACE_NODE, &ip_pim_bfd_param_cmd); install_element(INTERFACE_NODE, &ip_pim_bfd_param_cmd);
install_element(INTERFACE_NODE, &no_ip_pim_bfd_cmd); install_element(INTERFACE_NODE, &no_ip_pim_bfd_cmd);
#if HAVE_BFDD == 0
install_element(INTERFACE_NODE, &no_ip_pim_bfd_param_cmd); install_element(INTERFACE_NODE, &no_ip_pim_bfd_param_cmd);
#endif /* !HAVE_BFDD */
} }