Commit graph

27 commits

Author SHA1 Message Date
Martin Mares
730f2e2c8c Added dumping of routing tables (`show route'). This includes filtering. 1999-12-01 15:10:21 +00:00
Martin Mares
3579376927 cli_msg() moved to cli.h, so that it can be used outside the parser. 1999-11-25 15:34:51 +00:00
Martin Mares
ffb59d243a Command line interface now works. 1999-11-17 12:00:21 +00:00
Martin Mares
944f008af7 Defined CF_ENUM. 1999-11-15 11:35:41 +00:00
Pavel Machek
f453665704 Enumerational types, defined keyword added. 1999-11-10 12:44:07 +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
41be4444f2 switch() { } done right. 1999-10-28 21:03:36 +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
Pavel Machek
9d79fec8dc Added notion of datetime 1999-05-26 14:24:32 +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
Pavel Machek
36bbfc704c Updated filters: they now actually see IP/pxlen of net being filtered,
gateway, and who told us, so they can do usefull jobs from now on.
1999-04-19 18:41:56 +00:00
Pavel Machek
38506f71b0 Sets of integers now actually work. Sets of IP will work as soon as
compare function is ready.
1999-04-12 19:58:18 +00:00
Pavel Machek
23b1539bf9 Filters upgraded - a bit. Moved code to filter.c because it is where
it belongs. (f-util.c stays there for auxiliary and non-important things.)
1999-04-07 12:11:08 +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
e0f2e42f4f A couple of filter tweaks:
o  Introduced struct filter which serves as an external reference
      to filter. Using struct symbol for this is unwise since it doesn't
      allow extra information attached to the filter and it also forces
      all filters to be named.
   o  Implemented config rule 'filter' which matches either named filter
      or an embedded unnamed filter (`{ <filter> }').
   o  Fixed totally bogus comment at the top of filter.h.
   o  Added a missing prototype for f_run() to filter.h.
1999-03-17 14:29:39 +00:00
Pavel Machek
1aa5cf1c61 Added '=' to operator list 1999-03-09 14:44:43 +00:00
Pavel Machek
b700582445 Filters are now a tiny bit stronger (if is actually working ;-) 1999-03-08 20:30:06 +00:00
Martin Mares
c9b6670608 Original expr' is back, filter expressions renamed to term'.
In the future, we'll allow any filter term in place of `expr' and we'll
just evaluate it immediately, but not now as we have no evaluation
routines.
1999-01-15 18:04:28 +00:00
Martin Mares
e3a39a9ee7 Killed duplicate %type for expr. 1999-01-15 16:59:26 +00:00
Pavel Machek
b9d70dc84e Filters, second try. This time they have their own directory. 1999-01-15 16:49:17 +00:00
Pavel Machek
72380a3447 Filters added. They are unable to do anything interesting for now
(with exception of printing integers to screen), but they exist.
1999-01-15 14:41:51 +00:00
Martin Mares
89d2355d3d Added new rule for prefix length / netmask. 1998-12-06 23:10:45 +00:00
Martin Mares
166b9c4912 Added rule "bool" for boolean switches. 1998-12-06 17:38:42 +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
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
f142750d34 Base of the parser. 1998-11-27 19:36:06 +00:00