diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2013-11-23 11:50:34 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2013-11-23 11:50:34 +0100 |
commit | 736e143fa50607fcd88132291e96089b899af979 (patch) | |
tree | c0fcd5fb3174bae8a39b3a32dfe582b2ccb6df17 /nest/cmds.c | |
parent | 094d2bdb79e1ffa0a02761fd651aa0f0b6b0c585 (diff) | |
parent | 2b3d52aa421ae1c31e30107beefd82fddbb42854 (diff) |
Merge branch 'master' into add-path
Conflicts:
filter/filter.c
nest/proto.c
nest/rt-table.c
proto/bgp/bgp.h
proto/bgp/config.Y
Diffstat (limited to 'nest/cmds.c')
-rw-r--r-- | nest/cmds.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/nest/cmds.c b/nest/cmds.c index 2a803930..ec6bc762 100644 --- a/nest/cmds.c +++ b/nest/cmds.c @@ -13,6 +13,10 @@ #include "nest/cmds.h" #include "lib/string.h" #include "lib/resource.h" +#include "filter/filter.h" + +extern int shutting_down; +extern int configuring; void cmd_show_status(void) @@ -27,9 +31,10 @@ cmd_show_status(void) cli_msg(-1011, "Last reboot on %s", tim); tm_format_datetime(tim, &config->tf_base, config->load_time); cli_msg(-1011, "Last reconfiguration on %s", tim); + if (shutting_down) cli_msg(13, "Shutdown in progress"); - else if (old_config) + else if (configuring) cli_msg(13, "Reconfiguration in progress"); else cli_msg(13, "Daemon is up and running"); @@ -86,3 +91,20 @@ cmd_show_memory(void) print_size("Total:", rmemsize(&root_pool)); cli_msg(0, ""); } + +void +cmd_eval(struct f_inst *expr) +{ + struct f_val v = f_eval(expr, this_cli->parser_pool); + + if (v.type == T_RETURN) + { + cli_msg(8008, "runtime error"); + return; + } + + buffer buf; + LOG_BUFFER_INIT(buf); + val_format(v, &buf); + cli_msg(23, "%s", buf.start); +} |