summaryrefslogtreecommitdiffstats
path: root/staticd/static_vty.c
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2023-02-28 10:08:41 +0100
committerChristian Hopps <chopps@labn.net>2023-03-22 03:09:07 +0100
commitd1e85e36008136fcbd0ab2133a78c30af3e612fc (patch)
treeff42b64227d032735c7f1d89a1fed4d52914f986 /staticd/static_vty.c
parentmgmtd: nb library for client front-end code (diff)
downloadfrr-d1e85e36008136fcbd0ab2133a78c30af3e612fc.tar.xz
frr-d1e85e36008136fcbd0ab2133a78c30af3e612fc.zip
mgmtd: Enroll Staticd as a backend client for MGMTD
This commmit introduces Staticd as a backend client for the MGMTd framework. All the static commands will be diverted to the MGMT daemon and will use the transactional model to make changes to the internal state. Similar mechanism can be used by other daemons to use the MGMT framework in the future. This commit includes the following functionalities in the changeset: 1. Diverts all the staticd (config only) commands to MGMTd. 2. Enrolls staticd as a backend client to use the MGMT framework. 3. Modify the staticd NB config handlers so that they can be compiled into a library and loaded in the MGMTd process context. Co-authored-by: Pushpasis Sarkar <pushpasis@gmail.com> Co-authored-by: Abhinay Ramesh <rabhinay@vmware.com> Co-authored-by: Ujwal P <ujwalp@vmware.com> Signed-off-by: Yash Ranjan <ranjany@vmware.com>
Diffstat (limited to '')
-rw-r--r--staticd/static_vty.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/staticd/static_vty.c b/staticd/static_vty.c
index d87ca16c6..bfffbe6a6 100644
--- a/staticd/static_vty.c
+++ b/staticd/static_vty.c
@@ -1452,15 +1452,18 @@ DEFPY_YANG(debug_staticd, debug_staticd_cmd,
"Debug route\n"
"Debug bfd\n")
{
+#ifndef INCLUDE_MGMTD_CMDDEFS_ONLY
/* If no specific category, change all */
if (strmatch(argv[argc - 1]->text, "static"))
static_debug_set(vty->node, !no, true, true, true);
else
static_debug_set(vty->node, !no, !!events, !!route, !!bfd);
+#endif /* ifndef INCLUDE_MGMTD_CMDDEFS_ONLY */
return CMD_SUCCESS;
}
+#ifndef INCLUDE_MGMTD_CMDDEFS_ONLY
DEFPY(staticd_show_bfd_routes, staticd_show_bfd_routes_cmd,
"show bfd static route [json]$isjson",
SHOW_STR
@@ -1496,9 +1499,15 @@ static struct cmd_node debug_node = {
.config_write = static_config_write_debug,
};
+#endif /* ifndef INCLUDE_MGMTD_CMDDEFS_ONLY */
+
void static_vty_init(void)
{
+#ifndef INCLUDE_MGMTD_CMDDEFS_ONLY
install_node(&debug_node);
+ install_element(ENABLE_NODE, &show_debugging_static_cmd);
+ install_element(ENABLE_NODE, &staticd_show_bfd_routes_cmd);
+#endif /* ifndef INCLUDE_MGMTD_CMDDEFS_ONLY */
install_element(CONFIG_NODE, &ip_mroute_dist_cmd);
@@ -1516,9 +1525,6 @@ void static_vty_init(void)
install_element(CONFIG_NODE, &ipv6_route_cmd);
install_element(VRF_NODE, &ipv6_route_vrf_cmd);
- install_element(ENABLE_NODE, &show_debugging_static_cmd);
install_element(ENABLE_NODE, &debug_staticd_cmd);
install_element(CONFIG_NODE, &debug_staticd_cmd);
-
- install_element(ENABLE_NODE, &staticd_show_bfd_routes_cmd);
}