diff options
author | GalaxyGorilla <sascha@netdef.org> | 2020-07-10 13:26:55 +0200 |
---|---|---|
committer | GalaxyGorilla <sascha@netdef.org> | 2020-07-10 13:28:43 +0200 |
commit | 4affdba79e306d3eab88af0ed63a7ca38ceb77f9 (patch) | |
tree | 4fc8adba02c7c0a9fa4eea1c48eecd1fa527e867 /isisd/isis_cli.c | |
parent | Merge pull request #6385 from GalaxyGorilla/bfd_igp_topotest (diff) | |
download | frr-4affdba79e306d3eab88af0ed63a7ca38ceb77f9.tar.xz frr-4affdba79e306d3eab88af0ed63a7ca38ceb77f9.zip |
*: add BFD profile support for IS-IS
BFD profiles can now be used on the interface level like this:
interface eth1
ip router isis 1
isis bfd
isis bfd profile default
Here the 'default' profile needs to be specified as usual in the
bfdd configuration.
Signed-off-by: GalaxyGorilla <sascha@netdef.org>
Diffstat (limited to 'isisd/isis_cli.c')
-rw-r--r-- | isisd/isis_cli.c | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/isisd/isis_cli.c b/isisd/isis_cli.c index df69b1c7b..6ea3c5fb5 100644 --- a/isisd/isis_cli.c +++ b/isisd/isis_cli.c @@ -330,8 +330,7 @@ void cli_show_ip_isis_ipv6(struct vty *vty, struct lyd_node *dnode, DEFPY(isis_bfd, isis_bfd_cmd, "[no] isis bfd", - NO_STR - PROTO_HELP + NO_STR PROTO_HELP "Enable BFD support\n") { const struct lyd_node *dnode; @@ -343,19 +342,53 @@ DEFPY(isis_bfd, return CMD_SUCCESS; } - nb_cli_enqueue_change(vty, "./frr-isisd:isis/bfd-monitoring", + nb_cli_enqueue_change(vty, "./frr-isisd:isis/bfd-monitoring/enabled", NB_OP_MODIFY, no ? "false" : "true"); return nb_cli_apply_changes(vty, NULL); } +/* + * XPath: /frr-interface:lib/interface/frr-isisd:isis/bfd-monitoring/profile + */ +DEFPY(isis_bfd_profile, + isis_bfd_profile_cmd, + "[no] isis bfd profile WORD", + NO_STR PROTO_HELP + "Enable BFD support\n" + "Use a pre-configured profile\n" + "Profile name\n") +{ + const struct lyd_node *dnode; + + dnode = yang_dnode_get(vty->candidate_config->dnode, + "%s/frr-isisd:isis", VTY_CURR_XPATH); + if (dnode == NULL) { + vty_out(vty, "ISIS is not enabled on this circuit\n"); + return CMD_SUCCESS; + } + + nb_cli_enqueue_change(vty, "./frr-isisd:isis/bfd-monitoring/profile", + NB_OP_MODIFY, no ? NULL : profile); + + return nb_cli_apply_changes(vty, NULL); +} + void cli_show_ip_isis_bfd_monitoring(struct vty *vty, struct lyd_node *dnode, bool show_defaults) { - if (!yang_dnode_get_bool(dnode, NULL)) + const char *profile; + + if (!yang_dnode_get_bool(dnode, "./enabled")) vty_out(vty, " no"); vty_out(vty, " isis bfd\n"); + + if (yang_dnode_exists(dnode, "./profile")) { + profile = yang_dnode_get_string(dnode, "./profile"); + if (profile[0] != '\0') + vty_out(vty, " isis bfd profile %s\n", profile); + } } /* @@ -2301,6 +2334,7 @@ void isis_cli_init(void) install_element(INTERFACE_NODE, &ip6_router_isis_cmd); install_element(INTERFACE_NODE, &no_ip_router_isis_cmd); install_element(INTERFACE_NODE, &isis_bfd_cmd); + install_element(INTERFACE_NODE, &isis_bfd_profile_cmd); install_element(ISIS_NODE, &net_cmd); |