mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-18 00:58:42 +00:00
62a4639548
To define a new command, just add a new rule to the gramar: CF_CLI(COMMAND NAME, arguments, help-args, help-text) { what-should-the-command-do } ; where <arguments> are appended to the RHS of the rule, <help-args> is the argument list as shown in the help and <help-text> is description of the command for the help. <what-should-the-command-do> is a C code snippet to be executed. It should not take too much time to execute. If you want to print out a lot of information, you can schedule a routine to be called after the current buffer is flushed by making cli->cont point to the routine (see the TEST LONG command definition for an example); if the connection is closed in the meantime, cli->cleanup gets called. You can access `struct cli' belonging to the connection you're currently servicing as this_cli, but only during parse time, not from routines scheduled for deferred execution. Functions to call inside command handlers: cli_printf(cli, code, printf-args) -- print text to CLI connection, <code> is message code as assigned in doc/reply_codes or a negative one if it's a continuation line. cli_msg(code, printf-args) -- the same for this_cli. Use 'sock -x bird.ctl' for connecting to the CLI until a client is written. |
||
---|---|---|
.. | ||
bird.h | ||
cli.c | ||
cli.h | ||
config.Y | ||
iface.c | ||
iface.h | ||
Makefile | ||
password.c | ||
password.h | ||
proto.c | ||
protocol.h | ||
route.h | ||
rt-attr.c | ||
rt-dev.c | ||
rt-dev.h | ||
rt-fib.c | ||
rt-table.c |