Skip to content

Commit

Permalink
ripngd: convert RPC commands to mgmtd
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Ryzhov <[email protected]>
  • Loading branch information
idryzhov committed Mar 22, 2024
1 parent d6a17a1 commit d7e621c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 21 deletions.
7 changes: 7 additions & 0 deletions mgmtd/mgmt_be_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ static const char *const ripngd_oper_xpaths[] = {
"/frr-ripngd:ripngd",
NULL,
};
static const char *const ripngd_rpc_xpaths[] = {
"/frr-ripngd",
NULL,
};
#endif

#if HAVE_STATICD
Expand Down Expand Up @@ -155,6 +159,9 @@ 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
#ifdef HAVE_RIPNGD
[MGMTD_BE_CLIENT_ID_RIPNGD] = ripngd_rpc_xpaths,
#endif
};

/*
Expand Down
19 changes: 19 additions & 0 deletions ripngd/ripng_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,23 @@ DEFPY_YANG(no_ripng_ipv6_distribute_list_prefix,
return nb_cli_apply_changes(vty, NULL);
}

/*
* XPath: /frr-ripngd:clear-ripng-route
*/
DEFPY_YANG (clear_ipv6_rip,
clear_ipv6_rip_cmd,
"clear ipv6 ripng [vrf WORD]",
CLEAR_STR
IPV6_STR
"Clear IPv6 RIP database\n"
VRF_CMD_HELP_STR)
{
if (vrf)
nb_cli_rpc_enqueue(vty, "vrf", vrf);

return nb_cli_rpc(vty, "/frr-ripngd:clear-ripng-route", NULL);
}

/* RIPng node structure. */
static struct cmd_node cmd_ripng_node = {
.name = "ripng",
Expand Down Expand Up @@ -663,6 +680,8 @@ void ripng_cli_init(void)

install_element(INTERFACE_NODE, &ipv6_ripng_split_horizon_cmd);

install_element(ENABLE_NODE, &clear_ipv6_rip_cmd);

if_rmap_init(RIPNG_NODE);
}

Expand Down
20 changes: 0 additions & 20 deletions ripngd/ripngd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2231,25 +2231,6 @@ DEFUN (show_ipv6_ripng_status,
return CMD_SUCCESS;
}

#include "ripngd/ripngd_clippy.c"

/*
* XPath: /frr-ripngd:clear-ripng-route
*/
DEFPY_YANG (clear_ipv6_rip,
clear_ipv6_rip_cmd,
"clear ipv6 ripng [vrf WORD]",
CLEAR_STR
IPV6_STR
"Clear IPv6 RIP database\n"
VRF_CMD_HELP_STR)
{
if (vrf)
nb_cli_rpc_enqueue(vty, "vrf", vrf);

return nb_cli_rpc(vty, "/frr-ripngd:clear-ripng-route", NULL);
}

/* Update ECMP routes to zebra when ECMP is disabled. */
void ripng_ecmp_disable(struct ripng *ripng)
{
Expand Down Expand Up @@ -2667,7 +2648,6 @@ void ripng_init(void)
/* Install ripng commands. */
install_element(VIEW_NODE, &show_ipv6_ripng_cmd);
install_element(VIEW_NODE, &show_ipv6_ripng_status_cmd);
install_element(ENABLE_NODE, &clear_ipv6_rip_cmd);

ripng_if_init();
ripng_debug_init();
Expand Down
1 change: 0 additions & 1 deletion ripngd/subdir.am
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ ripngd_ripngd_SOURCES = \

clippy_scan += \
ripngd/ripng_cli.c \
ripngd/ripngd.c \
# end

noinst_HEADERS += \
Expand Down

0 comments on commit d7e621c

Please sign in to comment.