Added DEBUG commands.

Removed CLI tests, real commands now serve as much better examples.
This commit is contained in:
Martin Mares 1999-12-04 23:17:29 +00:00
parent feed822676
commit 305a01f57b
2 changed files with 17 additions and 29 deletions

8
TODO
View file

@ -1,7 +1,5 @@
Core Core
~~~~ ~~~~
* protocols: implement dumping of protocol-dependent rte attributes
- IPv6 support - IPv6 support
- io.c: refuse old-style multicasts for unnumbered interfaces? - io.c: refuse old-style multicasts for unnumbered interfaces?
@ -16,8 +14,6 @@ Core
- static: check validity of route destination? - static: check validity of route destination?
- static: allow specifying a per-route filter program for setting route attributes? - static: allow specifying a per-route filter program for setting route attributes?
- *: show route hooks
- rte_update: check whether all bits not covered by masklen are zero - rte_update: check whether all bits not covered by masklen are zero
- rte_update: debug mode - rte_update: debug mode
@ -48,12 +44,11 @@ Commands
~~~~~~~~ ~~~~~~~~
shutdown # order system shutdown shutdown # order system shutdown
configure [<file>] configure [<file>]
debug <what> # dump debugging information to log
show <name> # show everything you know about symbol <name> show <name> # show everything you know about symbol <name>
rip ??? [<name>] rip ??? [<name>]
ospf ??? [<name>] ospf ??? [<name>]
static ??? [<name>] static ??? [<name>]
filters [<name>] symbols
(disable|enable|restart) <protocol> # or ALL? (disable|enable|restart) <protocol> # or ALL?
Cleanup Cleanup
@ -68,6 +63,7 @@ Cleanup
- try compiling with -Wunused - try compiling with -Wunused
- does everybody test return value of sk_open? - does everybody test return value of sk_open?
- add references to RFC's we did follow - add references to RFC's we did follow
- protocols: implement CLI hooks
Various ideas Various ideas
~~~~~~~~~~~~~ ~~~~~~~~~~~~~

View file

@ -251,30 +251,22 @@ r_args:
} }
; ;
/* FIXME: These are examples. Remove them soon. */ CF_CLI_HELP(DEBUG, <subsystem>, [[Show debugging information]])
CF_CLI_HELP(TEST, <subsystem>, [[Tests different subsystems]]) CF_CLI(DEBUG RESOURCES,,, [[Show all allocated resource]])
CF_CLI(TEST LEDS, NUM, <N>, [[Flash each LED <N> times]]) { cli_msg(0, "%d", $3); } ; { rdump(&root_pool); }
CF_CLI(TEST MEMORY,,, [[Replace all useful information by testing patterns]]) { cli_msg(0, "DONE"); } ; CF_CLI(DEBUG SOCKETS,,, [[Show open sockets]])
CF_CLI(TEST LONG,,, [[Test long replies]]) { { sk_dump_all(); }
static void test_command(struct cli *); CF_CLI(DEBUG INTERFACES,,, [[Show interface information]])
this_cli->cont = test_command; { if_dump_all(); }
this_cli->rover = (void *) 1; CF_CLI(DEBUG NEIGHBORS,,, [[Show neighbor cache]])
cli_msg(-2, "Start"); { 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 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 CF_END