]> git.puffer.fish Git - mirror/frr.git/commitdiff
ripd: fix "clear ip rip" command
authorIgor Ryzhov <iryzhov@nfware.com>
Fri, 8 Mar 2024 22:00:12 +0000 (00:00 +0200)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Sat, 9 Mar 2024 10:16:38 +0000 (10:16 +0000)
mgmtd doesn't support YANG RPCs yet, so this command must go directly to
ripd.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit 1ba97510e2683e6178973be98f1004a45462621e)

ripd/rip_cli.c
ripd/ripd.c
ripd/subdir.am

index 2e967698ea5919a5d0840995fbdead0ed8e28a2d..4d4349b81affd204413b946b9de7e2937cba983b 100644 (file)
@@ -1125,36 +1125,6 @@ void cli_show_ip_rip_bfd_profile(struct vty *vty, const struct lyd_node *dnode,
                yang_dnode_get_string(dnode, 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)
-{
-       struct list *input;
-       int ret;
-
-       input = list_new();
-       if (vrf) {
-               struct yang_data *yang_vrf;
-
-               yang_vrf = yang_data_new("/frr-ripd:clear-rip-route/input/vrf",
-                                        vrf);
-               listnode_add(input, yang_vrf);
-       }
-
-       ret = nb_cli_rpc(vty, "/frr-ripd:clear-rip-route", input, NULL);
-
-       list_delete(&input);
-
-       return ret;
-}
-
 DEFPY_YANG(
        rip_distribute_list, rip_distribute_list_cmd,
        "distribute-list ACCESSLIST4_NAME$name <in|out>$dir [WORD$ifname]",
@@ -1325,8 +1295,6 @@ 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 b8a140c9ca5a8be267f74e81507c2779b98f7edb..e3220a9267f3e2b13b8fe2e2ceb5ebe79d7ff2c5 100644 (file)
@@ -3254,6 +3254,38 @@ 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)
+{
+       struct list *input;
+       int ret;
+
+       input = list_new();
+       if (vrf) {
+               struct yang_data *yang_vrf;
+
+               yang_vrf = yang_data_new("/frr-ripd:clear-rip-route/input/vrf",
+                                        vrf);
+               listnode_add(input, yang_vrf);
+       }
+
+       ret = nb_cli_rpc(vty, "/frr-ripd:clear-rip-route", input, NULL);
+
+       list_delete(&input);
+
+       return ret;
+}
+
 /* Distribute-list update functions. */
 static void rip_distribute_update(struct distribute_ctx *ctx,
                                  struct distribute *dist)
@@ -3628,6 +3660,7 @@ 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 aed8d249fea207ddd953e7f789f9040f55575039..7fb3726077df05dae107cfead02e549ab697f5e7 100644 (file)
@@ -33,6 +33,7 @@ ripd_ripd_SOURCES = \
 clippy_scan += \
        ripd/rip_bfd.c \
        ripd/rip_cli.c \
+       ripd/ripd.c \
        # end
 
 noinst_HEADERS += \