diff options
author | Martin Mares <mj@ucw.cz> | 1999-11-25 15:35:30 +0000 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 1999-11-25 15:35:30 +0000 |
commit | ae97b946e99bef043613d210489a926fe4807ec1 (patch) | |
tree | 6e8d2e4cd898dd67ef44e7bb851156039f681bbe /nest/config.Y | |
parent | 35793769273f7286aafa0455547d1d7cfeef3931 (diff) |
Added few basic commands: show status, show interfaces [summary],
show protocols (incomplete).
Diffstat (limited to 'nest/config.Y')
-rw-r--r-- | nest/config.Y | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/nest/config.Y b/nest/config.Y index 4000b6dc..7d3cbd72 100644 --- a/nest/config.Y +++ b/nest/config.Y @@ -27,6 +27,7 @@ CF_ENUM(T_ENUM_RTS, RTS_, DUMMY, STATIC, INHERIT, DEVICE, STATIC_DEVICE, REDIREC %type <f> imexport %type <r> rtable %type <p> password_list password_begin +%type <s> optsym CF_GRAMMAR @@ -187,9 +188,25 @@ password_list: /* Core commands */ +CF_CLI_HELP(SHOW,,[[Show status information]]) + +CF_CLI(SHOW STATUS,,, [[Show router status]]) { + cli_msg(2000, "BIRD " BIRD_VERSION); + /* FIXME: Should include uptime, shutdown flag et cetera */ +} ; + +CF_CLI(SHOW PROTOCOLS, optsym, [<name>], [[Show routing protocols]]) +{ proto_show($3); } ; + +CF_CLI(SHOW INTERFACES,,, [[Show network interfaces]]) +{ if_show(); } ; + +CF_CLI(SHOW INTERFACES SUMMARY,,, [[Show summary of network interfaces]]) +{ if_show_summary(); } ; + /* FIXME: These are examples. Remove them soon. */ CF_CLI_HELP(TEST, <subsystem>, [[Tests different subsystems]]) -CF_CLI(TEST LEDS, NUM, <N>, [[Flashes each LED <N> times]]) { cli_msg(0, "%d", $3); } ; +CF_CLI(TEST LEDS, NUM, <N>, [[Flash each LED <N> times]]) { cli_msg(0, "%d", $3); } ; CF_CLI(TEST MEMORY,,, [[Replace all useful information by testing patterns]]) { cli_msg(0, "DONE"); } ; CF_CLI(TEST LONG,,, [[Test long replies]]) { static void test_command(struct cli *); @@ -198,8 +215,14 @@ CF_CLI(TEST LONG,,, [[Test long replies]]) { cli_msg(-2, "Start"); } ; +optsym: + SYM + | /* empty */ { $$ = NULL; } + ; + CF_CODE +/* FIXME: Test only, remove */ static void test_command(struct cli *c) { int i = (int) c->rover; |