diff options
Diffstat (limited to 'mgmtd')
-rw-r--r-- | mgmtd/mgmt_be_adapter.c | 25 | ||||
-rw-r--r-- | mgmtd/mgmt_main.c | 24 | ||||
-rw-r--r-- | mgmtd/mgmt_vty.c | 2 | ||||
-rw-r--r-- | mgmtd/subdir.am | 3 |
4 files changed, 25 insertions, 29 deletions
diff --git a/mgmtd/mgmt_be_adapter.c b/mgmtd/mgmt_be_adapter.c index 675465750..8d7ae8855 100644 --- a/mgmtd/mgmt_be_adapter.c +++ b/mgmtd/mgmt_be_adapter.c @@ -65,6 +65,23 @@ struct mgmt_be_xpath_map { * above map as well. */ +static const char *const zebra_config_xpaths[] = { + "/frr-affinity-map:lib", + "/frr-filter:lib", + "/frr-route-map:lib", + "/frr-zebra:zebra", + "/frr-interface:lib", + "/frr-vrf:lib", + NULL, +}; + +static const char *const zebra_oper_xpaths[] = { + "/frr-interface:lib/interface", + "/frr-vrf:lib/vrf/frr-zebra:zebra", + "/frr-zebra:zebra", + NULL, +}; + #if HAVE_RIPD static const char *const ripd_config_xpaths[] = { "/frr-filter:lib", @@ -105,6 +122,7 @@ static const char *const staticd_config_xpaths[] = { #endif static const char *const *be_client_config_xpaths[MGMTD_BE_CLIENT_ID_MAX] = { + [MGMTD_BE_CLIENT_ID_ZEBRA] = zebra_config_xpaths, #ifdef HAVE_RIPD [MGMTD_BE_CLIENT_ID_RIPD] = ripd_config_xpaths, #endif @@ -116,13 +134,6 @@ static const char *const *be_client_config_xpaths[MGMTD_BE_CLIENT_ID_MAX] = { #endif }; -static const char *const zebra_oper_xpaths[] = { - "/frr-interface:lib/interface", - "/frr-vrf:lib/vrf/frr-zebra:zebra", - "/frr-zebra:zebra", - NULL, -}; - static const char *const *be_client_oper_xpaths[MGMTD_BE_CLIENT_ID_MAX] = { #ifdef HAVE_RIPD [MGMTD_BE_CLIENT_ID_RIPD] = ripd_oper_xpaths, diff --git a/mgmtd/mgmt_main.c b/mgmtd/mgmt_main.c index e71637bbd..6dbd1f2e5 100644 --- a/mgmtd/mgmt_main.c +++ b/mgmtd/mgmt_main.c @@ -18,6 +18,7 @@ #include "ripngd/ripng_nb.h" #include "routing_nb.h" #include "affinitymap.h" +#include "zebra/zebra_cli.h" /* mgmt options, we use GNU getopt library. */ static const struct option longopts[] = { @@ -143,32 +144,11 @@ static struct frr_signal_t mgmt_signals[] = { extern const struct frr_yang_module_info frr_staticd_cli_info; #endif -#if HAVE_BFDD == 0 || defined(HAVE_RTADV) -const char *zebra_features[] = { -#if HAVE_BFDD == 0 - "ptm-bfd", -#endif -#if defined(HAVE_RTADV) - "ipv6-router-advertisements", -#endif - NULL -}; -#endif - /* * These are stub info structs that are used to load the modules used by backend * clients into mgmtd. The modules are used by libyang in order to support * parsing binary data returns from the backend. */ -const struct frr_yang_module_info zebra_info = { - .name = "frr-zebra", -#if HAVE_BFDD == 0 || defined(HAVE_RTADV) - .features = zebra_features, -#endif - .ignore_cfg_cbs = true, - .nodes = { { .xpath = NULL } }, -}; - const struct frr_yang_module_info zebra_route_map_info = { .name = "frr-zebra-route-map", .ignore_cfg_cbs = true, @@ -191,7 +171,7 @@ static const struct frr_yang_module_info *const mgmt_yang_modules[] = { * YANG module info used by backend clients get added here. */ - &zebra_info, + &frr_zebra_cli_info, &zebra_route_map_info, #ifdef HAVE_RIPD diff --git a/mgmtd/mgmt_vty.c b/mgmtd/mgmt_vty.c index d5cfbbf77..7135bc554 100644 --- a/mgmtd/mgmt_vty.c +++ b/mgmtd/mgmt_vty.c @@ -26,6 +26,7 @@ #include "ripd/rip_nb.h" #include "ripngd/ripng_nb.h" #include "staticd/static_vty.h" +#include "zebra/zebra_cli.h" extern struct frr_daemon_info *mgmt_daemon_info; @@ -579,6 +580,7 @@ void mgmt_vty_init(void) * backend components that are moved to new MGMTD infra * here one by one. */ + zebra_cli_init(); #if HAVE_RIPD rip_cli_init(); #endif diff --git a/mgmtd/subdir.am b/mgmtd/subdir.am index e3008bab8..a3955925e 100644 --- a/mgmtd/subdir.am +++ b/mgmtd/subdir.am @@ -16,6 +16,7 @@ clippy_scan += \ lib_LTLIBRARIES += mgmtd/libmgmt_be_nb.la mgmtd_libmgmt_be_nb_la_SOURCES = \ + zebra/zebra_cli.c \ # end nodist_mgmtd_libmgmt_be_nb_la_SOURCES = \ lib/affinitymap_cli.c \ @@ -44,6 +45,7 @@ noinst_HEADERS += \ mgmtd/mgmt_history.h \ mgmtd/mgmt_memory.h \ mgmtd/mgmt_txn.h \ + zebra/zebra_cli.h \ # end sbin_PROGRAMS += mgmtd/mgmtd @@ -52,6 +54,7 @@ mgmtd_mgmtd_SOURCES = \ mgmtd/mgmt_main.c \ # end nodist_mgmtd_mgmtd_SOURCES = \ + yang/frr-zebra.yang.c \ # nothing mgmtd_mgmtd_CFLAGS = $(AM_CFLAGS) -I ./ mgmtd_mgmtd_LDADD = mgmtd/libmgmtd.a lib/libfrr.la $(LIBCAP) $(LIBM) $(LIBYANG_LIBS) $(UST_LIBS) |