summaryrefslogtreecommitdiffstats
path: root/nest/cmds.c
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-01-19 13:30:19 +0100
committerMartin Mares <mj@ucw.cz>2000-01-19 13:30:19 +0100
commit4b87e256eba51a8711c24fbae501ac7975b4ecd3 (patch)
treeadab4bad12941ac757d7b0a586ab42b7d09b9817 /nest/cmds.c
parentf5ad9f87a389c1167a8468d0190bcf6d3cc33cf6 (diff)
downloadbird-4b87e256eba51a8711c24fbae501ac7975b4ecd3.tar
bird-4b87e256eba51a8711c24fbae501ac7975b4ecd3.zip
Split off general commands to cmds.c.
Added `show symbols' command which dumps whole symbol table together with symbol types etc.
Diffstat (limited to 'nest/cmds.c')
-rw-r--r--nest/cmds.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/nest/cmds.c b/nest/cmds.c
new file mode 100644
index 0000000..c4443f9
--- /dev/null
+++ b/nest/cmds.c
@@ -0,0 +1,35 @@
+/*
+ * BIRD Internet Routing Daemon -- CLI Commands Which Don't Fit Anywhere Else
+ *
+ * (c) 2000 Martin Mares <mj@ucw.cz>
+ *
+ * Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+#include "nest/bird.h"
+#include "nest/cli.h"
+#include "conf/conf.h"
+#include "nest/cmds.h"
+#include "lib/string.h"
+
+void
+cmd_show_status(void)
+{
+ cli_msg(1000, "BIRD " BIRD_VERSION);
+ /* FIXME: Should include uptime, shutdown flag et cetera */
+}
+
+void
+cmd_show_symbols(struct symbol *sym)
+{
+ int pos = 0;
+
+ if (sym)
+ cli_msg(1010, "%s\t%s", sym->name, cf_symbol_class_name(sym));
+ else
+ {
+ while (sym = cf_walk_symbols(config, sym, &pos))
+ cli_msg(-1010, "%s\t%s", sym->name, cf_symbol_class_name(sym));
+ cli_msg(0, "");
+ }
+}