diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2024-03-21 17:10:42 +0200 |
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2024-04-22 16:36:23 +0300 |
| commit | dbaf05ae3df9c285c2660cbd32483e690c7b1a8a (patch) | |
| tree | 60494260dbe1fc8edbf3a8628e201507bfa3001f /ripd | |
| parent | a94f74bc2ed8165b66c640096586e78f63a0aaf4 (diff) | |
ripd: convert RPC commands to mgmtd
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'ripd')
| -rw-r--r-- | ripd/rip_cli.c | 19 | ||||
| -rw-r--r-- | ripd/ripd.c | 20 | ||||
| -rw-r--r-- | ripd/subdir.am | 1 |
3 files changed, 19 insertions, 21 deletions
diff --git a/ripd/rip_cli.c b/ripd/rip_cli.c index 4d4349b81a..7066485be0 100644 --- a/ripd/rip_cli.c +++ b/ripd/rip_cli.c @@ -1233,6 +1233,23 @@ DEFPY_YANG(no_rip_distribute_list_prefix, return nb_cli_apply_changes(vty, NULL); } +/* + * XPath: /frr-ripd:clear-rip-route + */ +DEFPY_YANG (clear_ip_rip, + clear_ip_rip_cmd, + "clear ip rip [vrf WORD]", + CLEAR_STR + IP_STR + "Clear IP RIP database\n" + VRF_CMD_HELP_STR) +{ + if (vrf) + nb_cli_rpc_enqueue(vty, "vrf", vrf); + + return nb_cli_rpc(vty, "/frr-ripd:clear-rip-route", NULL); +} + /* RIP node structure. */ static struct cmd_node rip_node = { .name = "rip", @@ -1295,6 +1312,8 @@ void rip_cli_init(void) install_element(INTERFACE_NODE, &ip_rip_bfd_profile_cmd); install_element(INTERFACE_NODE, &no_ip_rip_bfd_profile_cmd); + install_element(ENABLE_NODE, &clear_ip_rip_cmd); + if_rmap_init(RIP_NODE); } /* clang-format off */ diff --git a/ripd/ripd.c b/ripd/ripd.c index 4640880e49..b8a140c9ca 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -3254,25 +3254,6 @@ DEFUN (show_ip_rip_status, return CMD_SUCCESS; } -#include "ripd/ripd_clippy.c" - -/* - * XPath: /frr-ripd:clear-rip-route - */ -DEFPY_YANG (clear_ip_rip, - clear_ip_rip_cmd, - "clear ip rip [vrf WORD]", - CLEAR_STR - IP_STR - "Clear IP RIP database\n" - VRF_CMD_HELP_STR) -{ - if (vrf) - nb_cli_rpc_enqueue(vty, "vrf", vrf); - - return nb_cli_rpc(vty, "/frr-ripd:clear-rip-route", NULL); -} - /* Distribute-list update functions. */ static void rip_distribute_update(struct distribute_ctx *ctx, struct distribute *dist) @@ -3647,7 +3628,6 @@ void rip_init(void) /* Install rip commands. */ install_element(VIEW_NODE, &show_ip_rip_cmd); install_element(VIEW_NODE, &show_ip_rip_status_cmd); - install_element(ENABLE_NODE, &clear_ip_rip_cmd); /* Debug related init. */ rip_debug_init(); diff --git a/ripd/subdir.am b/ripd/subdir.am index 7fb3726077..aed8d249fe 100644 --- a/ripd/subdir.am +++ b/ripd/subdir.am @@ -33,7 +33,6 @@ ripd_ripd_SOURCES = \ clippy_scan += \ ripd/rip_bfd.c \ ripd/rip_cli.c \ - ripd/ripd.c \ # end noinst_HEADERS += \ |
