summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2023-02-28 04:00:32 +0100
committerChristian Hopps <chopps@labn.net>2023-03-22 03:08:32 +0100
commitfc52ca1e18f5cabff96f2dca1004bd81cee0ecab (patch)
tree0f39bc66ef8cc164c634a149ff01169da5108f79
parentmgmtd: Add MGMT Transaction Framework (diff)
downloadfrr-fc52ca1e18f5cabff96f2dca1004bd81cee0ecab.tar.xz
frr-fc52ca1e18f5cabff96f2dca1004bd81cee0ecab.zip
mgmtd: nb library for client front-end code
Signed-off-by: Christian Hopps <chopps@labn.net>
-rw-r--r--debian/frr.install1
-rw-r--r--mgmtd/subdir.am8
-rw-r--r--python/xref2vtysh.py10
3 files changed, 19 insertions, 0 deletions
diff --git a/debian/frr.install b/debian/frr.install
index 044b48498..02912d448 100644
--- a/debian/frr.install
+++ b/debian/frr.install
@@ -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
diff --git a/mgmtd/subdir.am b/mgmtd/subdir.am
index 2387917f9..d56fd9345 100644
--- a/mgmtd/subdir.am
+++ b/mgmtd/subdir.am
@@ -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
diff --git a/python/xref2vtysh.py b/python/xref2vtysh.py
index a4f8560bb..b5873a3aa 100644
--- a/python/xref2vtysh.py
+++ b/python/xref2vtysh.py
@@ -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