From ae97b946e99bef043613d210489a926fe4807ec1 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Thu, 25 Nov 1999 15:35:30 +0000 Subject: Added few basic commands: show status, show interfaces [summary], show protocols (incomplete). --- nest/config.Y | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'nest/config.Y') diff --git a/nest/config.Y b/nest/config.Y index 4000b6d..7d3cbd7 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 imexport %type rtable %type

password_list password_begin +%type 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, [], [[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, , [[Tests different subsystems]]) -CF_CLI(TEST LEDS, NUM, , [[Flashes each LED times]]) { cli_msg(0, "%d", $3); } ; +CF_CLI(TEST LEDS, NUM, , [[Flash each LED 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; -- cgit v1.2.3