]> git.puffer.fish Git - matthieu/frr.git/commitdiff
mgmtd: nb library for client front-end code
authorChristian Hopps <chopps@labn.net>
Tue, 28 Feb 2023 03:00:32 +0000 (22:00 -0500)
committerChristian Hopps <chopps@labn.net>
Wed, 22 Mar 2023 02:08:32 +0000 (22:08 -0400)
Signed-off-by: Christian Hopps <chopps@labn.net>
debian/frr.install
mgmtd/subdir.am
python/xref2vtysh.py

index 044b48498458079cb46b7422844f7ea4229b30e6..02912d448dee5b49f3296c4cdffb730809ec6e5d 100644 (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
index 2387917f998ee30baf6d8c15aa8dcb2b906befae..d56fd93450684f8d266aebc3812599fd45f3bc49 100644 (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
index a4f8560bb07fb7a94d250dadf652ebb6c223acbc..b5873a3aac5b48e53bb735f9476e6609c5ad0c72 100644 (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