summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2019-12-06 14:38:55 +0100
committerDavid Lamparter <equinox@diac24.net>2019-12-06 15:13:29 +0100
commit1c0d880814e3fcf76b3351e6756c8ec378f357cb (patch)
treec3c92aca5cea0c05e335ccdb102cb839fc8ff07e
parentb0a89c27ad2e7f980d6bf9c78c6ff6a5cfe058c7 (diff)
lib: rename memory_vty.c to lib_vty.c
And memory_init() to lib_cmd_init(). Signed-off-by: David Lamparter <equinox@diac24.net>
-rw-r--r--bgpd/bgp_main.c1
-rw-r--r--bgpd/bgp_vty.c2
-rw-r--r--isisd/isis_main.c1
-rw-r--r--lib/grammar_sandbox.c1
-rw-r--r--lib/grammar_sandbox_main.c4
-rw-r--r--lib/lib_vty.c (renamed from lib/memory_vty.c)26
-rw-r--r--lib/lib_vty.h (renamed from lib/memory_vty.h)8
-rw-r--r--lib/libfrr.c5
-rw-r--r--lib/subdir.am5
-rw-r--r--nhrpd/nhrp_main.c1
-rw-r--r--ospf6d/ospf6_main.c1
-rw-r--r--ospfd/ospf_main.c1
-rw-r--r--pimd/pim_main.c1
-rw-r--r--ripd/rip_main.c1
-rw-r--r--ripngd/ripng_main.c1
-rw-r--r--tests/helpers/c/main.c4
-rw-r--r--tests/lib/cli/common_cli.c4
-rw-r--r--tests/lib/cxxcompat.c2
-rw-r--r--tests/lib/northbound/test_oper_data.c4
-rw-r--r--tests/lib/test_buffer.c4
-rw-r--r--tests/lib/test_privs.c4
-rwxr-xr-xvtysh/extract.pl.in2
-rw-r--r--vtysh/vtysh_main.c1
-rw-r--r--watchfrr/watchfrr.c1
-rw-r--r--zebra/main.c1
25 files changed, 37 insertions, 49 deletions
diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c
index 08c5d3468d..9cb3957a86 100644
--- a/bgpd/bgp_main.c
+++ b/bgpd/bgp_main.c
@@ -27,7 +27,6 @@
#include "thread.h"
#include <lib/version.h>
#include "memory.h"
-#include "memory_vty.h"
#include "prefix.h"
#include "log.h"
#include "privs.h"
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index fa236a24b7..553131b747 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -32,7 +32,7 @@
#include "thread.h"
#include "log.h"
#include "memory.h"
-#include "memory_vty.h"
+#include "lib_vty.h"
#include "hash.h"
#include "queue.h"
#include "filter.h"
diff --git a/isisd/isis_main.c b/isisd/isis_main.c
index 7e79fdea15..364441f79d 100644
--- a/isisd/isis_main.c
+++ b/isisd/isis_main.c
@@ -29,7 +29,6 @@
#include "command.h"
#include "vty.h"
#include "memory.h"
-#include "memory_vty.h"
#include "stream.h"
#include "if.h"
#include "privs.h"
diff --git a/lib/grammar_sandbox.c b/lib/grammar_sandbox.c
index c6fd3c04ad..a23874a517 100644
--- a/lib/grammar_sandbox.c
+++ b/lib/grammar_sandbox.c
@@ -28,7 +28,6 @@
#endif
#include "command.h"
-#include "memory_vty.h"
#include "graph.h"
#include "linklist.h"
#include "command_match.h"
diff --git a/lib/grammar_sandbox_main.c b/lib/grammar_sandbox_main.c
index 6d28a667b3..4bd8f5138a 100644
--- a/lib/grammar_sandbox_main.c
+++ b/lib/grammar_sandbox_main.c
@@ -28,7 +28,7 @@
#endif
#include "command.h"
-#include "memory_vty.h"
+#include "lib_vty.h"
static void vty_do_exit(int isexit)
{
@@ -57,7 +57,7 @@ int main(int argc, char **argv)
host.domainname = strdup("testdomainname");
vty_init(master, true);
- memory_init();
+ lib_cmd_init();
yang_init();
nb_init(master, NULL, 0);
diff --git a/lib/memory_vty.c b/lib/lib_vty.c
index 1adc0d7b74..932b465015 100644
--- a/lib/memory_vty.c
+++ b/lib/lib_vty.c
@@ -1,5 +1,5 @@
/*
- * Memory and dynamic module VTY routine
+ * Assorted library VTY commands
*
* Copyright (C) 1998 Kunihiro Ishiguro
* Copyright (C) 2016-2017 David Lamparter for NetDEF, Inc.
@@ -35,7 +35,7 @@
#include "log.h"
#include "memory.h"
#include "module.h"
-#include "memory_vty.h"
+#include "lib_vty.h"
/* Looking up memory status from vty interface. */
#include "vector.h"
@@ -120,11 +120,11 @@ static int qmem_walker(void *arg, struct memgroup *mg, struct memtype *mt)
}
-DEFUN (show_memory,
- show_memory_cmd,
- "show memory",
- "Show running system information\n"
- "Memory statistics\n")
+DEFUN_NOSH (show_memory,
+ show_memory_cmd,
+ "show memory",
+ "Show running system information\n"
+ "Memory statistics\n")
{
#ifdef HAVE_MALLINFO
show_memory_mallinfo(vty);
@@ -134,11 +134,11 @@ DEFUN (show_memory,
return CMD_SUCCESS;
}
-DEFUN (show_modules,
- show_modules_cmd,
- "show modules",
- "Show running system information\n"
- "Loaded modules\n")
+DEFUN_NOSH (show_modules,
+ show_modules_cmd,
+ "show modules",
+ "Show running system information\n"
+ "Loaded modules\n")
{
struct frrmod_runtime *plug = frrmod_list;
@@ -177,7 +177,7 @@ DEFUN (show_modules,
return CMD_SUCCESS;
}
-void memory_init(void)
+void lib_cmd_init(void)
{
install_element(VIEW_NODE, &show_memory_cmd);
install_element(VIEW_NODE, &show_modules_cmd);
diff --git a/lib/memory_vty.h b/lib/lib_vty.h
index 941255be1d..48e409ec52 100644
--- a/lib/memory_vty.h
+++ b/lib/lib_vty.h
@@ -18,8 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef _ZEBRA_MEMORY_VTY_H
-#define _ZEBRA_MEMORY_VTY_H
+#ifndef _ZEBRA_LIB_VTY_H
+#define _ZEBRA_LIB_VTY_H
#include "memory.h"
@@ -27,7 +27,7 @@
extern "C" {
#endif
-extern void memory_init(void);
+extern void lib_cmd_init(void);
/* Human friendly string for given byte count */
#define MTYPE_MEMSTR_LEN 20
@@ -37,4 +37,4 @@ extern const char *mtype_memstr(char *, size_t, unsigned long);
}
#endif
-#endif /* _ZEBRA_MEMORY_VTY_H */
+#endif /* _ZEBRA_LIB_VTY_H */
diff --git a/lib/libfrr.c b/lib/libfrr.c
index 8ef32eaa8a..5f292c989c 100644
--- a/lib/libfrr.c
+++ b/lib/libfrr.c
@@ -30,7 +30,7 @@
#include "vty.h"
#include "command.h"
#include "version.h"
-#include "memory_vty.h"
+#include "lib_vty.h"
#include "log_vty.h"
#include "zclient.h"
#include "log_int.h"
@@ -679,7 +679,7 @@ struct thread_master *frr_init(void)
cmd_init(1);
vty_init(master, di->log_always);
- memory_init();
+ lib_cmd_init();
log_filter_cmd_init();
frr_pthread_init();
@@ -1077,7 +1077,6 @@ void frr_fini(void)
hook_call(frr_fini);
- /* memory_init -> nothing needed */
vty_terminate();
cmd_terminate();
nb_terminate();
diff --git a/lib/subdir.am b/lib/subdir.am
index 23b1950384..be059c8946 100644
--- a/lib/subdir.am
+++ b/lib/subdir.am
@@ -40,13 +40,13 @@ lib_libfrr_la_SOURCES = \
lib/json.c \
lib/keychain.c \
lib/lib_errors.c \
+ lib/lib_vty.c \
lib/libfrr.c \
lib/linklist.c \
lib/log.c \
lib/log_vty.c \
lib/md5.c \
lib/memory.c \
- lib/memory_vty.c \
lib/mlag.c \
lib/module.c \
lib/mpls.c \
@@ -114,6 +114,7 @@ vtysh_scan += \
$(top_srcdir)/lib/if.c \
$(top_srcdir)/lib/if_rmap.c \
$(top_srcdir)/lib/keychain.c \
+ $(top_srcdir)/lib/lib_vty.c \
$(top_srcdir)/lib/nexthop_group.c \
$(top_srcdir)/lib/plist.c \
$(top_srcdir)/lib/routemap.c \
@@ -179,6 +180,7 @@ pkginclude_HEADERS += \
lib/json.h \
lib/keychain.h \
lib/lib_errors.h \
+ lib/lib_vty.h \
lib/libfrr.h \
lib/libospf.h \
lib/linklist.h \
@@ -186,7 +188,6 @@ pkginclude_HEADERS += \
lib/log_vty.h \
lib/md5.h \
lib/memory.h \
- lib/memory_vty.h \
lib/module.h \
lib/monotime.h \
lib/mpls.h \
diff --git a/nhrpd/nhrp_main.c b/nhrpd/nhrp_main.c
index a781122b16..b58fe776ab 100644
--- a/nhrpd/nhrp_main.c
+++ b/nhrpd/nhrp_main.c
@@ -21,7 +21,6 @@
#include "version.h"
#include "log.h"
#include "memory.h"
-#include "memory_vty.h"
#include "command.h"
#include "libfrr.h"
diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c
index 0fa5585b80..0aaefeb3c2 100644
--- a/ospf6d/ospf6_main.c
+++ b/ospf6d/ospf6_main.c
@@ -28,7 +28,6 @@
#include "command.h"
#include "vty.h"
#include "memory.h"
-#include "memory_vty.h"
#include "if.h"
#include "filter.h"
#include "prefix.h"
diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c
index a542b4da83..d02ffe0448 100644
--- a/ospfd/ospf_main.c
+++ b/ospfd/ospf_main.c
@@ -35,7 +35,6 @@
#include "stream.h"
#include "log.h"
#include "memory.h"
-#include "memory_vty.h"
#include "privs.h"
#include "sigevent.h"
#include "zclient.h"
diff --git a/pimd/pim_main.c b/pimd/pim_main.c
index 3f79b304e5..f0ca367258 100644
--- a/pimd/pim_main.c
+++ b/pimd/pim_main.c
@@ -29,7 +29,6 @@
#include "memory.h"
#include "vrf.h"
-#include "memory_vty.h"
#include "filter.h"
#include "vty.h"
#include "sigevent.h"
diff --git a/ripd/rip_main.c b/ripd/rip_main.c
index 26504a857d..060bb76585 100644
--- a/ripd/rip_main.c
+++ b/ripd/rip_main.c
@@ -25,7 +25,6 @@
#include "thread.h"
#include "command.h"
#include "memory.h"
-#include "memory_vty.h"
#include "prefix.h"
#include "filter.h"
#include "keychain.h"
diff --git a/ripngd/ripng_main.c b/ripngd/ripng_main.c
index 0024345500..9daeeb9580 100644
--- a/ripngd/ripng_main.c
+++ b/ripngd/ripng_main.c
@@ -27,7 +27,6 @@
#include "vty.h"
#include "command.h"
#include "memory.h"
-#include "memory_vty.h"
#include "thread.h"
#include "log.h"
#include "prefix.h"
diff --git a/tests/helpers/c/main.c b/tests/helpers/c/main.c
index b1dcfcf707..2de29cbdbc 100644
--- a/tests/helpers/c/main.c
+++ b/tests/helpers/c/main.c
@@ -24,7 +24,7 @@
#include "vty.h"
#include "command.h"
#include "memory.h"
-#include "memory_vty.h"
+#include "lib_vty.h"
extern void test_init(void);
@@ -154,7 +154,7 @@ int main(int argc, char **argv)
/* Library inits. */
cmd_init(1);
vty_init(master, false);
- memory_init();
+ lib_cmd_init();
yang_init();
nb_init(master, NULL, 0);
diff --git a/tests/lib/cli/common_cli.c b/tests/lib/cli/common_cli.c
index 2071ae08cd..e091372ab8 100644
--- a/tests/lib/cli/common_cli.c
+++ b/tests/lib/cli/common_cli.c
@@ -25,7 +25,7 @@
#include "vty.h"
#include "command.h"
#include "memory.h"
-#include "memory_vty.h"
+#include "lib_vty.h"
#include "log.h"
#include "common_cli.h"
@@ -83,7 +83,7 @@ int main(int argc, char **argv)
cmd_domainname_set("test.domain");
vty_init(master, false);
- memory_init();
+ lib_cmd_init();
yang_init();
nb_init(master, NULL, 0);
diff --git a/tests/lib/cxxcompat.c b/tests/lib/cxxcompat.c
index 88126e84bc..391ccd9268 100644
--- a/tests/lib/cxxcompat.c
+++ b/tests/lib/cxxcompat.c
@@ -51,13 +51,13 @@
#include "lib/json.h"
#include "lib/keychain.h"
#include "lib/lib_errors.h"
+#include "lib/lib_vty.h"
#include "lib/libfrr.h"
#include "lib/libospf.h"
#include "lib/linklist.h"
#include "lib/log.h"
#include "lib/md5.h"
#include "lib/memory.h"
-#include "lib/memory_vty.h"
#include "lib/mlag.h"
#include "lib/module.h"
#include "lib/monotime.h"
diff --git a/tests/lib/northbound/test_oper_data.c b/tests/lib/northbound/test_oper_data.c
index a28830e088..18d3180889 100644
--- a/tests/lib/northbound/test_oper_data.c
+++ b/tests/lib/northbound/test_oper_data.c
@@ -23,7 +23,7 @@
#include "vty.h"
#include "command.h"
#include "memory.h"
-#include "memory_vty.h"
+#include "lib_vty.h"
#include "log.h"
#include "northbound.h"
@@ -412,7 +412,7 @@ int main(int argc, char **argv)
cmd_init(1);
cmd_hostname_set("test");
vty_init(master, false);
- memory_init();
+ lib_cmd_init();
yang_init();
nb_init(master, modules, array_size(modules));
diff --git a/tests/lib/test_buffer.c b/tests/lib/test_buffer.c
index b56cc30cf3..7fb9a769d3 100644
--- a/tests/lib/test_buffer.c
+++ b/tests/lib/test_buffer.c
@@ -20,7 +20,7 @@
#include <zebra.h>
#include <memory.h>
-#include <memory_vty.h>
+#include <lib_vty.h>
#include <buffer.h>
struct thread_master *master;
@@ -32,7 +32,7 @@ int main(int argc, char **argv)
char junk[3];
char c = 'a';
- memory_init();
+ lib_cmd_init();
if ((argc != 2) || (sscanf(argv[1], "%d%1s", &n, junk) != 1)) {
fprintf(stderr, "Usage: %s <number of chars to simulate>\n",
diff --git a/tests/lib/test_privs.c b/tests/lib/test_privs.c
index de638bc67a..c06ebbeb38 100644
--- a/tests/lib/test_privs.c
+++ b/tests/lib/test_privs.c
@@ -22,7 +22,7 @@
#include "getopt.h"
#include "privs.h"
#include "memory.h"
-#include "memory_vty.h"
+#include "lib_vty.h"
zebra_capabilities_t _caps_p[] = {
ZCAP_NET_RAW, ZCAP_BIND, ZCAP_NET_ADMIN, ZCAP_DAC_OVERRIDE,
@@ -105,7 +105,7 @@ int main(int argc, char **argv)
}
/* Library inits. */
- memory_init();
+ lib_cmd_init();
zprivs_preinit(&test_privs);
zprivs_init(&test_privs);
diff --git a/vtysh/extract.pl.in b/vtysh/extract.pl.in
index d0b0c701a7..e8df08ef60 100755
--- a/vtysh/extract.pl.in
+++ b/vtysh/extract.pl.in
@@ -96,7 +96,7 @@ sub scan_file {
elsif ($file =~ /lib\/if\.c$/) {
$protocol = "VTYSH_INTERFACE";
}
- elsif ($file =~ /lib\/filter\.c$/) {
+ elsif ($file =~ /lib\/(filter|lib_vty)\.c$/) {
$protocol = "VTYSH_ALL";
}
elsif ($file =~ /lib\/agentx\.c$/) {
diff --git a/vtysh/vtysh_main.c b/vtysh/vtysh_main.c
index c7e1d252c7..0ba1b9d9c8 100644
--- a/vtysh/vtysh_main.c
+++ b/vtysh/vtysh_main.c
@@ -45,7 +45,6 @@
#include "command.h"
#include "memory.h"
#include "linklist.h"
-#include "memory_vty.h"
#include "libfrr.h"
#include "ferr.h"
#include "lib_errors.h"
diff --git a/watchfrr/watchfrr.c b/watchfrr/watchfrr.c
index 4e8502107a..ed9616963d 100644
--- a/watchfrr/watchfrr.c
+++ b/watchfrr/watchfrr.c
@@ -25,7 +25,6 @@
#include <sigevent.h>
#include <lib/version.h>
#include "command.h"
-#include "memory_vty.h"
#include "libfrr.h"
#include "lib_errors.h"
diff --git a/zebra/main.c b/zebra/main.c
index 731c4e1614..c20674d2f0 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -27,7 +27,6 @@
#include "filter.h"
#include "memory.h"
#include "zebra_memory.h"
-#include "memory_vty.h"
#include "prefix.h"
#include "log.h"
#include "plist.h"