summaryrefslogtreecommitdiffstats
path: root/nest/config.Y
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1999-12-05 00:17:29 +0100
committerMartin Mares <mj@ucw.cz>1999-12-05 00:17:29 +0100
commit305a01f57bd97906000c36bb154d63bc90012ef7 (patch)
treeecfc75702b3b60c2513b8bc62f1883a1af47217f /nest/config.Y
parentfeed82267663c6826da896309de180417bd0b39f (diff)
downloadbird-305a01f57bd97906000c36bb154d63bc90012ef7.tar
bird-305a01f57bd97906000c36bb154d63bc90012ef7.zip
Added DEBUG commands.
Removed CLI tests, real commands now serve as much better examples.
Diffstat (limited to 'nest/config.Y')
-rw-r--r--nest/config.Y38
1 files changed, 15 insertions, 23 deletions
diff --git a/nest/config.Y b/nest/config.Y
index b5940cf..d357f25 100644
--- a/nest/config.Y
+++ b/nest/config.Y
@@ -251,30 +251,22 @@ r_args:
}
;
-/* FIXME: These are examples. Remove them soon. */
-CF_CLI_HELP(TEST, <subsystem>, [[Tests different subsystems]])
-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 *);
- this_cli->cont = test_command;
- this_cli->rover = (void *) 1;
- cli_msg(-2, "Start");
-} ;
+CF_CLI_HELP(DEBUG, <subsystem>, [[Show debugging information]])
+CF_CLI(DEBUG RESOURCES,,, [[Show all allocated resource]])
+{ rdump(&root_pool); }
+CF_CLI(DEBUG SOCKETS,,, [[Show open sockets]])
+{ sk_dump_all(); }
+CF_CLI(DEBUG INTERFACES,,, [[Show interface information]])
+{ if_dump_all(); }
+CF_CLI(DEBUG NEIGHBORS,,, [[Show neighbor cache]])
+{ neigh_dump_all(); }
+CF_CLI(DEBUG ATTRIBUTES,,, [[Show attribute cache]])
+{ rta_dump_all(); }
+CF_CLI(DEBUG ROUTES,,, [[Show routing table]])
+{ rt_dump_all(); }
+CF_CLI(DEBUG PROTOCOLS,,, [[Show protocol information]])
+{ protos_dump_all(); }
CF_CODE
-/* FIXME: Test only, remove */
-static void test_command(struct cli *c)
-{
- int i = (int) c->rover;
- if (i < 10) {
- cli_printf(c, -3, "%d", i);
- c->rover = (void *) ++i;
- } else {
- c->cont = NULL;
- cli_printf(c, 4, "DONE");
- }
-}
-
CF_END