summaryrefslogtreecommitdiffstats
path: root/ripd
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ripd/rip_cli.c19
-rw-r--r--ripd/rip_main.c6
-rw-r--r--ripd/rip_nb_rpcs.c9
-rw-r--r--ripd/ripd.c35
-rw-r--r--ripd/subdir.am1
5 files changed, 29 insertions, 41 deletions
diff --git a/ripd/rip_cli.c b/ripd/rip_cli.c
index 4d4349b..7066485 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/rip_main.c b/ripd/rip_main.c
index 845c507..67469f5 100644
--- a/ripd/rip_main.c
+++ b/ripd/rip_main.c
@@ -23,6 +23,7 @@
#include "routemap.h"
#include "bfd.h"
#include "mgmt_be_client.h"
+#include "libagentx.h"
#include "ripd/ripd.h"
#include "ripd/rip_bfd.h"
@@ -131,6 +132,8 @@ static const struct frr_yang_module_info *const ripd_yang_modules[] = {
&frr_ripd_info,
&frr_route_map_info,
&frr_vrf_info,
+ &ietf_key_chain_info,
+ &ietf_key_chain_deviation_info,
};
/* clang-format off */
@@ -188,8 +191,9 @@ int main(int argc, char **argv)
master = frr_init();
/* Library initialization. */
+ libagentx_init();
rip_error_init();
- keychain_init();
+ keychain_init_new(true);
rip_vrf_init();
/* RIP related initialization. */
diff --git a/ripd/rip_nb_rpcs.c b/ripd/rip_nb_rpcs.c
index bbe3d0f..5d3d714 100644
--- a/ripd/rip_nb_rpcs.c
+++ b/ripd/rip_nb_rpcs.c
@@ -68,12 +68,11 @@ static void clear_rip_route(struct rip *rip)
int clear_rip_route_rpc(struct nb_cb_rpc_args *args)
{
struct rip *rip;
- struct yang_data *yang_vrf;
- yang_vrf = yang_data_list_find(args->input, "%s/%s", args->xpath,
- "input/vrf");
- if (yang_vrf) {
- rip = rip_lookup_by_vrf_name(yang_vrf->value);
+ if (args->input && yang_dnode_exists(args->input, "vrf")) {
+ const char *name = yang_dnode_get_string(args->input, "vrf");
+
+ rip = rip_lookup_by_vrf_name(name);
if (rip)
clear_rip_route(rip);
} else {
diff --git a/ripd/ripd.c b/ripd/ripd.c
index e3220a9..ab4ffe5 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -1051,7 +1051,7 @@ static size_t rip_auth_md5_ah_write(struct stream *s, struct rip_interface *ri,
/* RFC2080: The value used in the sequence number is
arbitrary, but two suggestions are the time of the
message's creation or a simple message counter. */
- stream_putl(s, ++seq);
+ stream_putl(s, seq++);
/* Reserved field must be zero. */
stream_putl(s, 0);
@@ -3254,38 +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)
-{
- 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)
@@ -3660,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 7fb3726..aed8d24 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 += \