]> git.puffer.fish Git - mirror/frr.git/commitdiff
ripd: convert RPC commands to mgmtd
authorIgor Ryzhov <iryzhov@nfware.com>
Thu, 21 Mar 2024 15:10:42 +0000 (17:10 +0200)
committerIgor Ryzhov <iryzhov@nfware.com>
Mon, 22 Apr 2024 13:36:23 +0000 (16:36 +0300)
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
mgmtd/mgmt_be_adapter.c
ripd/rip_cli.c
ripd/ripd.c
ripd/subdir.am

index f4fa389b879b8a5ed730c2a30d80c0a7cbe30908..d830120af10af949674b31df6c54b51f910cd834 100644 (file)
@@ -98,6 +98,10 @@ static const char *const ripd_oper_xpaths[] = {
        "/ietf-key-chain:key-chains",
        NULL,
 };
+static const char *const ripd_rpc_xpaths[] = {
+       "/frr-ripd",
+       NULL,
+};
 #endif
 
 #if HAVE_RIPNGD
@@ -147,7 +151,11 @@ static const char *const *be_client_oper_xpaths[MGMTD_BE_CLIENT_ID_MAX] = {
        [MGMTD_BE_CLIENT_ID_ZEBRA] = zebra_oper_xpaths,
 };
 
-static const char *const *be_client_rpc_xpaths[MGMTD_BE_CLIENT_ID_MAX] = {};
+static const char *const *be_client_rpc_xpaths[MGMTD_BE_CLIENT_ID_MAX] = {
+#ifdef HAVE_RIPD
+       [MGMTD_BE_CLIENT_ID_RIPD] = ripd_rpc_xpaths,
+#endif
+};
 
 /*
  * We would like to have a better ADT than one with O(n) comparisons
index 4d4349b81affd204413b946b9de7e2937cba983b..7066485be065651d1037db850df7e682081579b4 100644 (file)
@@ -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 */
index 4640880e49414597051b9082e4f85a8446671d28..b8a140c9ca5a8be267f74e81507c2779b98f7edb 100644 (file)
@@ -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();
index 7fb3726077df05dae107cfead02e549ab697f5e7..aed8d249fea207ddd953e7f789f9040f55575039 100644 (file)
@@ -33,7 +33,6 @@ ripd_ripd_SOURCES = \
 clippy_scan += \
        ripd/rip_bfd.c \
        ripd/rip_cli.c \
-       ripd/ripd.c \
        # end
 
 noinst_HEADERS += \