diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2024-01-17 14:58:03 +0200 |
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2024-01-28 23:28:39 +0200 |
| commit | df296d54aeb1ccb94ddbf9524a6643aef3783dfc (patch) | |
| tree | 25b4c0b350cb804cbd705c0627acf06898f463e6 /zebra/interface.c | |
| parent | efa18c6c6ff84a71c70435d901421599500af5d2 (diff) | |
zebra: convert interface link-detect command to NB
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'zebra/interface.c')
| -rw-r--r-- | zebra/interface.c | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index 541803eb9f..219dff083b 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -3801,28 +3801,16 @@ int if_linkdetect(struct interface *ifp, bool detect) return 0; } -DEFUN(linkdetect, linkdetect_cmd, "link-detect", +DEFPY_YANG (linkdetect, + linkdetect_cmd, + "[no] link-detect", + NO_STR "Enable link detection on interface\n") { - VTY_DECLVAR_CONTEXT(interface, ifp); - - if_linkdetect(ifp, true); - - return CMD_SUCCESS; -} - - -DEFUN (no_linkdetect, - no_linkdetect_cmd, - "no link-detect", - NO_STR - "Disable link detection on interface\n") -{ - VTY_DECLVAR_CONTEXT(interface, ifp); - - if_linkdetect(ifp, false); - - return CMD_SUCCESS; + nb_cli_enqueue_change(vty, "./frr-zebra:zebra/link-detect", + NB_OP_CREATE, no ? "false" : "true"); + + return nb_cli_apply_changes(vty, NULL); } int if_shutdown(struct interface *ifp) @@ -5569,7 +5557,6 @@ void zebra_if_init(void) install_element(INTERFACE_NODE, &no_multicast_cmd); install_element(INTERFACE_NODE, &mpls_cmd); install_element(INTERFACE_NODE, &linkdetect_cmd); - install_element(INTERFACE_NODE, &no_linkdetect_cmd); install_element(INTERFACE_NODE, &shutdown_if_cmd); install_element(INTERFACE_NODE, &no_shutdown_if_cmd); install_element(INTERFACE_NODE, &bandwidth_if_cmd); |
