summaryrefslogtreecommitdiff
path: root/nest/cmds.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2012-03-16 12:47:12 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2012-03-16 12:47:12 +0100
commit0f808c066f3b5b190de951db042a34a1eb957a16 (patch)
tree7b54bd3f5965d6c02ef096f01176c0161d312e97 /nest/cmds.c
parent20ab192beca749166e19118e987b53b5e131d0cf (diff)
Adds filtering to 'show symbols' command.
Thanks Alexander V. Chernikov for the original patch.
Diffstat (limited to 'nest/cmds.c')
-rw-r--r--nest/cmds.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/nest/cmds.c b/nest/cmds.c
index 8ac32096..62d7c9b4 100644
--- a/nest/cmds.c
+++ b/nest/cmds.c
@@ -7,6 +7,7 @@
*/
#include "nest/bird.h"
+#include "nest/route.h"
#include "nest/cli.h"
#include "conf/conf.h"
#include "nest/cmds.h"
@@ -35,16 +36,22 @@ cmd_show_status(void)
}
void
-cmd_show_symbols(struct symbol *sym)
+cmd_show_symbols(struct sym_show_data *sd)
{
int pos = 0;
+ struct symbol *sym = sd->sym;
if (sym)
- cli_msg(1010, "%s\t%s", sym->name, cf_symbol_class_name(sym));
+ cli_msg(1010, "%-8s\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));
+ {
+ if (sd->type && (sym->class != sd->type))
+ continue;
+
+ cli_msg(-1010, "%-8s\t%s", sym->name, cf_symbol_class_name(sym));
+ }
cli_msg(0, "");
}
}