Commit graph

177 commits

Author SHA1 Message Date
Martin Mares
430da60fa2 Implemented `show route where <condition>' command.
Pavel, please check my addition to filter/config.Y.
1999-12-02 14:04:44 +00:00
Martin Mares
730f2e2c8c Added dumping of routing tables (`show route'). This includes filtering. 1999-12-01 15:10:21 +00:00
Martin Mares
f0474f2070 Use TIME_INFINITY for initialization of password entries instead
of 2000000000 (BTW who wrote that???)
1999-11-30 14:02:27 +00:00
Martin Mares
0d3e6bceee show interfaces' and show protocols' works. 1999-11-30 12:57:14 +00:00
Martin Mares
ae97b946e9 Added few basic commands: show status, show interfaces [summary],
show protocols (incomplete).
1999-11-25 15:35:30 +00:00
Martin Mares
62a4639548 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.
1999-11-17 12:14:44 +00:00
Martin Mares
7d509304b5 An example of how to define enums. 1999-11-15 11:36:22 +00:00
Martin Mares
bc2fb68098 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.
1999-10-31 17:47:47 +00:00
Pavel Machek
ac40c888c2 Obvious bugs in authentication fixed. 1999-10-02 10:44:48 +00:00
Martin Mares
dce267832a Basic support for IPv6. The system-dependent part doesn't work yet,
but the core routines are there and seem to be working.

   o  lib/ipv6.[ch] written
   o  Lexical analyser recognizes IPv6 addresses and when in IPv6
      mode, treats pure IPv4 addresses as router IDs.
   o  Router ID must be configured manually on IPv6 systems.
   o  Added SCOPE_ORGANIZATION for org-scoped IPv6 multicasts.
   o  Fixed few places where ipa_(hton|ntoh) was called as a function
      returning converted address.
1999-08-03 19:36:06 +00:00
Martin Mares
8edf2361f9 Cleaned up handling of interface patterns:
o  Parsing of interface patterns moved to generic code,
      introduced this_ipatt which works similarly to this_iface.
   o  Interface patterns now support selection by both interface
      names and primary IP addresses.
   o  Proto `direct' updated.
   o  RIP updated as well, it also seems the memory corruption
      bug there is gone.
1999-08-03 19:30:49 +00:00
Pavel Machek
900d5470ae Added PASSIVE option to paswwords. 1999-05-31 17:12:00 +00:00
Pavel Machek
858a717796 Change format of passwords (less ;'s) and fix password.h to allow
multiple inclusions.
1999-05-26 14:37:07 +00:00
Pavel Machek
1a2ded450e Skeleton for password handling, currently I only build structures and
do nothing more advanced for them
1999-05-26 14:24:57 +00:00
Martin Mares
0e02abfd57 From now we support multiple tables. The master_table variable is
definitely gone. Both rte_update() and rte_discard() have an additional
argument telling which table should they modify.

Also, rte_update() no longer walks the whole protocol list -- each table
has a list of all protocols connected to this table and having the
rt_notify hook set. Each protocol can also freely decide (by calling
proto_add_announce_hook) to connect to any other table, but it will
be probably used only by the table-to-table protocol.

The default debugging dumps now include all routing tables and also
all their connections.
1999-05-17 20:14:52 +00:00
Martin Mares
5056c559c4 Changed syntax of attaching filters to protocols to hopefully the final
version:

	EXPORT <filter-spec>	for outbound routes (i.e., those announced
				by BIRD to the rest of the world).
	IMPORT <filter-spec>	for inbound routes (i.e., those imported
				by BIRD from the rest of the world).

where <filter-spec> is one of:

	ALL			pass all routes
	NONE			drop all routes
	FILTER <name>		use named filter
	FILTER { <filter> }	use explicitly defined filter

For all protocols, the default is IMPORT ALL, EXPORT NONE. This includes
the kernel protocol, so that you need to add EXPORT ALL to get the previous
configuration of kernel syncer (as usually, see doc/bird.conf.example for
a bird.conf example :)).
1999-04-05 20:15:31 +00:00
Martin Mares
7f400d1c62 After today's lengthy discussions about filter syntax, let's clean up
whitespace/semicolon rules for whole config file:

   o  All non-zero amounts of whitespace are equivalent to single space
      (aka `all the whitespace has been born equal' ;-)).
   o  Comments count as whitespace.
   o  Whitespace has no syntactic signifance (it can only separate lexical
      elements).
   o  Consequence: line ends are no longer treated as `;'s.
   o  Every declaration must be terminated by an explicit `;' unless
      or by a group enclosed in `{' and `}'.
1999-03-29 19:04:14 +00:00
Martin Mares
7e5f5ffdda Moved to a much more systematic way of configuring kernel protocols.
o  Nothing is configured automatically. You _need_ to specify
     the kernel syncer in config file in order to get it started.
  o  Syncing has been split to route syncer (protocol "Kernel") and
     interface syncer (protocol "Device"), device routes are generated
     by protocol "Direct" (now can exist in multiple instances, so that
     it will be possible to feed different device routes to different
     routing tables once multiple tables get supported).

See doc/bird.conf.example for a living example of these shiny features.
1999-03-26 21:44:38 +00:00
Martin Mares
529c414953 Allow input and output filters (only accept/reject style as we didn't define
modifying filters yet) to be attached to protocol instances.
1999-03-17 14:31:26 +00:00
Martin Mares
31b3e1bbf5 Implemented new configuration/reconfiguration interface and defined protocol
state machines. Full explanation will follow soon.
1999-02-05 21:37:34 +00:00
Martin Mares
b35d72ac66 Name cleanups as suggested by Pavel:
- cfg_strcpy() -> cfg_strdup()
- mempool -> linpool, mp_* -> lp_*  [to avoid confusion with memblock, mb_*]

Anyway, it might be better to stop ranting about names and do some *real* work.
1998-12-06 11:59:18 +00:00
Martin Mares
50d8424ad1 Added configuration of the device internal protocol. This is primarily
intended to serve as an example of interface pattern list use. As a side
effect, you can disable generating of device routes by disabling
this protocol.
1998-11-29 22:03:58 +00:00
Martin Mares
bd5d0d62f1 Allow setting debug value and `disabled' flag in protocol definition. 1998-11-29 14:40:39 +00:00
Martin Mares
7af99789c7 Oops, forgot to remove a debugging kludge. 1998-11-27 21:34:03 +00:00
Martin Mares
0b62c3a7c7 Trivial 15-line bison excercise: Implemented expressions including
user-defined numeric symbols. Whenever possible, use `expr' instead
of `NUM' to get full express ion power :-)
1998-11-27 21:32:45 +00:00
Martin Mares
c74c0e3cdf First attempt at protocol configuration (now done only for RIP). 1998-11-27 21:09:57 +00:00
Martin Mares
da87782278 Parser fragment for the core. Now handles only router ID setting. 1998-11-27 19:37:57 +00:00