mgmtd: nb library for client front-end code

Signed-off-by: Christian Hopps <chopps@labn.net>
This commit is contained in:
Christian Hopps 2023-02-27 22:00:32 -05:00
parent 74335ceb27
commit fc52ca1e18
3 changed files with 19 additions and 0 deletions

1
debian/frr.install vendored
View File

@ -8,6 +8,7 @@ usr/bin/vtysh
usr/lib/*/frr/libfrr.*
usr/lib/*/frr/libfrrcares.*
usr/lib/*/frr/libfrrospfapiclient.*
usr/lib/*/frr/libmgmt_be_nb.*
usr/lib/*/frr/modules/bgpd_bmp.so
usr/lib/*/frr/modules/dplane_fpm_nl.so
usr/lib/*/frr/modules/zebra_cumulus_mlag.so

View File

@ -14,6 +14,13 @@ clippy_scan += \
mgmtd/mgmt_vty.c \
# end
lib_LTLIBRARIES += mgmtd/libmgmt_be_nb.la
nodist_mgmtd_libmgmt_be_nb_la_SOURCES = \
# end
mgmtd_libmgmt_be_nb_la_CFLAGS = $(AM_CFLAGS) -DINCLUDE_MGMTD_CMDDEFS_ONLY
mgmtd_libmgmt_be_nb_la_CPPFLAGS = $(AM_CPPFLAGS) -DINCLUDE_MGMTD_CMDDEFS_ONLY
mgmtd_libmgmt_be_nb_la_LDFLAGS = -version-info 0:0:0
noinst_LIBRARIES += mgmtd/libmgmtd.a
mgmtd_libmgmtd_a_SOURCES = \
mgmtd/mgmt.c \
@ -52,3 +59,4 @@ mgmtd_mgmtd_SOURCES = \
# end
mgmtd_mgmtd_CFLAGS = $(AM_CFLAGS) -I ./
mgmtd_mgmtd_LDADD = mgmtd/libmgmtd.a lib/libfrr.la $(LIBCAP) $(LIBM) $(LIBYANG_LIBS) $(UST_LIBS)
mgmtd_mgmtd_LDADD += mgmtd/libmgmt_be_nb.la

View File

@ -325,7 +325,17 @@ class CommandEntry:
def load(cls, xref):
nodes = NodeDict()
mgmtname = "mgmtd/libmgmt_be_nb.la"
for cmd_name, origins in xref.get("cli", {}).items():
# If mgmtd has a yang version of a CLI command, make it the only daemon
# to handle it. For now, daemons can still be compiling their cmds into the
# binaries to allow for running standalone with CLI config files. When they
# do this they will also be present in the xref file, but we want to ignore
# those in vtysh.
if "yang" in origins.get(mgmtname, {}).get("attrs", []):
CommandEntry.process(nodes, cmd_name, mgmtname, origins[mgmtname])
continue
for origin, spec in origins.items():
CommandEntry.process(nodes, cmd_name, origin, spec)
return nodes