Martin Mares [Fri, 3 Dec 1999 11:40:45 +0000 (11:40 +0000)]
Added proto_get_named() to be used in CLI commands to get protocol instance
of a given protocol with optionally given name. See `show static' for an
example.
Martin Mares [Wed, 1 Dec 1999 15:07:56 +0000 (15:07 +0000)]
Reset temporary parser data before parsing, not afterwards. This enables
deferred CLI command handlers to store their temporary data in the CLI
parsing pool.
Martin Mares [Wed, 1 Dec 1999 12:00:15 +0000 (12:00 +0000)]
`show protocols' now shows time of last state change and protocol-dependent
status information (obtained via newly introduced hook protocol->get_status).
Martin Mares [Wed, 1 Dec 1999 10:28:39 +0000 (10:28 +0000)]
Use linux-22 configuration with all 2.2.x and 2.3.x kernels. This means
you need to have your kernel compiled with netlink routing messages enabled.
If it doesn't work for you, use --with-sysconfig=linux-21 and let me know
what's going wrong.
Pavel Machek [Thu, 25 Nov 1999 14:54:08 +0000 (14:54 +0000)]
Bugfixes: select right password for password authentication, do not
try to process authentication blocks as datablocks, make it possible
to add data at end of packet. Password authentication should actually work.
Martin Mares [Thu, 18 Nov 1999 14:41:29 +0000 (14:41 +0000)]
Allow EA type to be set to 'undefined' which overrides all further definitons
of that EA in the same list and causes ea_find() to fail unless you add
EA_ALLOW_UNDEF to the second argument.
ea_sort (resp. ea_do_prune()) removes all undef'd attributes from the list.
Martin Mares [Wed, 17 Nov 1999 12:14:44 +0000 (12:14 +0000)]
Added some temporary examples of how to define CLI commands (search for CF_CLI).
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.
Martin Mares [Wed, 17 Nov 1999 12:04:24 +0000 (12:04 +0000)]
If the main event queue is not empty, call select() with zero timeout, so
that the events are ran again after the FD's are checked. This allows us
to schedule I/O checks between processing of user commands.
Martin Mares [Sun, 31 Oct 1999 17:47:47 +0000 (17:47 +0000)]
Parse CLI commands. We use the same parser as for configuration files (because
we want to allow filter and similar complex constructs to be used in commands
and we should avoid code duplication), only with CLI_MARKER token prepended
before the whole input.
Defined macro CF_CLI(cmd, args, help) for defining CLI commands in .Y files.
The first argument specifies the command itself, the remaining two arguments
are copied to the help file (er, will be copied after the help file starts
to exist). This macro automatically creates a skeleton rule for the command,
you only need to append arguments as in:
CF_CLI(STEAL MONEY, <$>, [[Steal <$> US dollars or equivalent in any other currency]]): NUM {
cli_msg(0, "%d$ stolen", $3);
} ;
Also don't forget to reset lexer state between inputs.
Martin Mares [Fri, 29 Oct 1999 12:08:49 +0000 (12:08 +0000)]
Events now return a value. If it's non-zero, the event is re-queued
for processing in next event cycle. This can be used to prevent background
actions (hint: user commands) from hogging the CPU for too long time.
Ondrej Filip [Mon, 18 Oct 1999 21:48:51 +0000 (21:48 +0000)]
Huge changes. Neighbor and interface state machines rewritten.
It should be cleaner now, I'm preparing for file splitting.
Maybe I added some minor bugs. :-(