summaryrefslogtreecommitdiffstats
path: root/vtysh
diff options
context:
space:
mode:
authorChristian Hopps <chopps@gmail.com>2021-05-04 16:41:58 +0200
committerChristian Hopps <chopps@labn.net>2021-05-13 22:24:48 +0200
commit3bb513c399c2e7c8dd597b7399dd7c0f064842d0 (patch)
tree14f3e677c49fce272946788f8a8b8f3f8a3e26b5 /vtysh
parentMerge pull request #8629 from donaldsharp/parse_rtattr (diff)
downloadfrr-3bb513c399c2e7c8dd597b7399dd7c0f064842d0.tar.xz
frr-3bb513c399c2e7c8dd597b7399dd7c0f064842d0.zip
lib: adapt to version 2 of libyang
Compile with v2.0.0 tag of `libyang2` branch of: https://github.com/CESNET/libyang staticd init load time of 10k routes now 6s vs ly1 time of 150s Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'vtysh')
-rwxr-xr-xvtysh/extract.pl.in2
-rw-r--r--vtysh/vtysh.c33
2 files changed, 34 insertions, 1 deletions
diff --git a/vtysh/extract.pl.in b/vtysh/extract.pl.in
index 37ae0ab18..86cf8c965 100755
--- a/vtysh/extract.pl.in
+++ b/vtysh/extract.pl.in
@@ -42,7 +42,7 @@ sub scan_file {
$cppadd = $fabricd ? "-DFABRICD=1" : "";
- open (FH, "@CPP@ -P -std=gnu11 -DHAVE_CONFIG_H -DVTYSH_EXTRACT_PL -Ivtysh/@top_builddir@ -Ivtysh/@top_srcdir@ -Ivtysh/@top_srcdir@/lib -Ivtysh/@top_builddir@/lib -Ivtysh/@top_srcdir@/bgpd -Ivtysh/@top_srcdir@/bgpd/rfapi @LUA_INCLUDE@ @CPPFLAGS@ $cppadd $file |");
+ open (FH, "@CPP@ -P -std=gnu11 -DHAVE_CONFIG_H -DVTYSH_EXTRACT_PL -Ivtysh/@top_builddir@ -Ivtysh/@top_srcdir@ -Ivtysh/@top_srcdir@/lib -Ivtysh/@top_builddir@/lib -Ivtysh/@top_srcdir@/bgpd -Ivtysh/@top_srcdir@/bgpd/rfapi @LUA_INCLUDE@ @CPPFLAGS@ @LIBYANG_CFLAGS@ $cppadd $file |");
local $/; undef $/;
$line = <FH>;
if (!close (FH)) {
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 336bd44a4..111c2dbc0 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -2890,6 +2890,37 @@ DEFUN (show_yang_operational_data,
return show_one_daemon(vty, argv, argc - 1, argv[argc - 1]->text);
}
+DEFUN(show_yang_module, show_yang_module_cmd,
+ "show yang module [module-translator WORD] " DAEMONS_LIST,
+ SHOW_STR
+ "YANG information\n"
+ "Show loaded modules\n"
+ "YANG module translator\n"
+ "YANG module translator\n" DAEMONS_STR)
+{
+ return show_one_daemon(vty, argv, argc - 1, argv[argc - 1]->text);
+}
+
+DEFUN(show_yang_module_detail, show_yang_module_detail_cmd,
+ "show yang module\
+ [module-translator WORD]\
+ WORD <compiled|summary|tree|yang|yin> " DAEMONS_LIST,
+ SHOW_STR
+ "YANG information\n"
+ "Show loaded modules\n"
+ "YANG module translator\n"
+ "YANG module translator\n"
+ "Module name\n"
+ "Display compiled module in YANG format\n"
+ "Display summary information about the module\n"
+ "Display module in the tree (RFC 8340) format\n"
+ "Display module in the YANG format\n"
+ "Display module in the YIN format\n" DAEMONS_STR)
+{
+ return show_one_daemon(vty, argv, argc - 1, argv[argc - 1]->text);
+}
+
+
DEFUNSH(VTYSH_ALL, debug_nb,
debug_nb_cmd,
"[no] debug northbound\
@@ -4449,6 +4480,8 @@ void vtysh_init_vty(void)
/* northbound */
install_element(ENABLE_NODE, &show_config_running_cmd);
install_element(ENABLE_NODE, &show_yang_operational_data_cmd);
+ install_element(ENABLE_NODE, &show_yang_module_cmd);
+ install_element(ENABLE_NODE, &show_yang_module_detail_cmd);
install_element(ENABLE_NODE, &debug_nb_cmd);
install_element(CONFIG_NODE, &debug_nb_cmd);