Commit graph

115 commits

Author SHA1 Message Date
Martin Mares
a2697f02ac Netlink support for secondary interface addresses. 1999-05-07 13:46:16 +00:00
Martin Mares
9a158361da I rewrote the interface handling code, so that it supports multiple
addresses per interface (needed for example for IPv6 support).

Visible changes:

o  struct iface now contains a list of all interface addresses (represented
   by struct ifa), iface->addr points to the primary address (if any).
o  Interface has IF_UP set iff it's up and it has a primary address.
o  IF_UP is now independent on IF_IGNORED (i.e., you need to test IF_IGNORED
   in the protocols; I've added this, but please check).
o  The if_notify_change hook has been simplified (only one interface pointer
   etc.).
o  Introduced a ifa_notify_change hook. (For now, only the Direct protocol
   does use it -- it's wise to just listen to device routes in all other
   protocols.)
o  Removed IF_CHANGE_FLAGS notifier flag (it was meaningless anyway).
o  Updated all the code except netlink (I'll look at it tomorrow) to match
   the new semantics (please look at your code to ensure I did it right).

Things to fix:

o  Netlink.
o  Make krt-iface interpret "eth0:1"-type aliases as secondary addresses.
1999-05-06 21:38:11 +00:00
Martin Mares
08e2d6259a Removed TOS support. This simplifies many things a lot. 1999-04-12 18:01:07 +00:00
Martin Mares
e2dc2f30ef Routing table core changes to support full route filtering:
o  Introduced rte_cow() which should be used for copying on write the
   rte's in filters. Each rte now carries a flag saying whether it's
   a real route (possessing table linkage and other insignia) or a local
   copy. This function can be expected to be fast since its fast-path
   is inlined.
o  Introduced rte_update_pool which is a linear memory pool used for
   all temporary data during rte_update. You should not reference it directly
   -- instead use a pool pointer passed to all related functions.
o  Split rte_update to three functions:

	rte_update	The front end: handles all checking, inbound
			filtering and calls rte_recalculate() for the
			final version of the route.
	rte_recalculate	Update the table according to already filtered route.
	rte_announce	Announce routing table changes to all protocols,
			passing them through export filters and so on.

   The interface has _not_ changed -- still call rte_update() and it will
   do the rest for you automagically.
o  Use new filtering semantics to be explained in a separate mail.
1999-04-05 20:25:03 +00:00
Martin Mares
9e0e485e50 Added some new protocol hooks (look at the comments for better explanation):
make_tmp_attrs		Convert inline attributes to ea_list
	store_tmp_attrs		Convert ea_list to inline attributes
	import_control		Pre-import decisions
1999-04-05 20:17:59 +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
c10421d3d4 More changes to the kernel syncer.
o  Now compatible with filtering.
o  Learning of kernel routes supported only on CONFIG_SELF_CONSCIOUS
   systems (on the others it's impossible to get it semantically correct).
o  Learning now stores all of its routes in a separate fib and selects
   the ones the kernel really uses for forwarding packets.
o  Better treatment of CONFIG_AUTO_ROUTES ports.
o  Lots of internal changes.
1999-04-03 13:05:18 +00:00
Martin Mares
69ec9087ad Added new protocol hook for dumping of protocol-dependent route
attributes.

Please implement in all protocols.
1999-04-03 13:01:58 +00:00
Martin Mares
5bc512aa3a Clarify resource dumps and include them in the main debugging dump. 1999-03-29 20:14:33 +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
7dc4827c96 Added everything protocols need to know about multiple routing tables,
i.e. struct proto now contains field 'table' pointing to routing table
the protocol is attached to. Use this instead of &master_table.

Modified all protocols except the kernel syncer to use this field.
1999-03-26 21:50:43 +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
739ebd8e82 Allow different instances of the same protocol with identical preferences. 1999-03-26 21:38:02 +00:00
Martin Mares
4ba84ebc82 Slightly better generator of default protocol instance names. 1999-03-26 21:37:29 +00:00
Martin Mares
b5239f2238 Don't try to manipulate neighbor lists for copied interface structures.
This avoids few nasty references to free memory.
1999-03-26 21:33:36 +00:00
Martin Mares
421838ffef rte_update: Check sanity of incoming entries. Throw out (and log) all routes
to bogus prefixes and non-local routes to host scope addresses.
1999-03-17 15:01:07 +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
c612a3be31 Removed the `rta_same' hook since it's no longer needed (all protocols
needing some local information should use extended attrs and cached
rta's).
1999-03-17 13:13:18 +00:00
Martin Mares
b77ae37d11 Implemented extended route attributes and all related functions. 1999-03-17 13:09:09 +00:00
Ondrej Filip
c1f8dc9149 Yes, joining the crew. Sorry for being late. Added dummy functions for OSPF. 1999-03-09 22:27:43 +00:00
Martin Mares
e16155ae4a KRT: Implemented asynchronous route / interface state notifications
(via Netlink). Tweaked kernel synchronization rules a bit. Discovered
locking bug in kernel Netlink :-)

Future plans: Hunt all the bugs and solve all the FIXME's.
1999-03-04 18:36:18 +00:00
Martin Mares
8fe48f1377 Initialize allocated struct proto :-) 1999-03-04 11:39:24 +00:00
Martin Mares
51ad41f2fc EFence helped to find using of already free rte's in rt_prune(). 1999-03-03 20:56:33 +00:00
Martin Mares
53b7a2982a Fix several things I broke today. 1999-03-03 20:55:35 +00:00
Martin Mares
0e889c5254 Added a hack forcing protocols with priority>0 to be started up
immediately. Grrr, need to find a real solution some day.
1999-03-03 20:40:51 +00:00
Martin Mares
b2280748ad Introduced protocol priority (all 'normal' protocols should use the
default zero priority). No more "kernel syncer initialized before
device routes" problems.
1999-03-03 19:33:54 +00:00
Martin Mares
e35ef181a4 o The if_change_too_big_p change was too high-spirited. Fixed.
o  Introduced if_find_by_index()
o  Recognizing two types of interface updates: full update (starting with
   if_start_update(), ending with if_end_update(), guaranteed to see
   all existing interfaces) and a partial update (only if_update(),
   usually due to asynchronous interface notifications).
1999-03-02 18:36:09 +00:00
Martin Mares
bcbd8cc3be Interface logic changes:
o  Introduced IF_LINK_UP flag corresponding to real link state.
o  Allowed addressless interfaces.
o  IF_UP is now automatically calculated and set iff the interface
   is administratively up, has link up and has an IP address assigned.
   It may be IF_IGNORED, though (as in case of the loopback).
o  Any changes which include up/down transition are considered small
   enough to not provoke artificial upping and downing of the interface.
o  When an interface disappears (i.e., it wasn't seen in the last scan),
   we announce this change only once.
o  IF_LOOPBACK implies IF_IGNORE.
1999-03-02 17:28:06 +00:00
Martin Mares
1b769b08c1 Renamed struct rtattr to struct rta to make things more consistent and
avoid namespace clashes with <linux/rtnetlink.h>. Other files should
not be affected since they use 'rta' directly.
1999-03-01 20:13:54 +00:00
Martin Mares
d1f7eab6b5 Parameter order for the proto->if_notify hook was different in the include
file and different in reality. Decided to use the same order as we do
for proto->rt_notify (i.e., first new value and second the old one).
1999-02-13 21:58:53 +00:00
Martin Mares
5996da6a1d Implemented garbage collection of routing tables to delete orphaned network
nodes having no routes attached. Such cleanup must be done from event handler
since most functions manipulating the routing tables expect network entries
won't disappear from under their hands and it's also probably faster when
done asynchronously.
1999-02-13 21:29:01 +00:00
Martin Mares
3fb4ca2ce2 Don't send any neighbor notifications to protocols being flushed. 1999-02-13 20:57:47 +00:00
Martin Mares
783f8b689a When protocols go down, prune the neighbor list. 1999-02-13 20:55:08 +00:00
Martin Mares
0a2e9d9f56 Moved sanity check of protocol state during annoucements to rte_announce. 1999-02-13 20:19:24 +00:00
Martin Mares
f4aabcee62 Perform gracious shutdown upon receipt of SIGTERM. Finally we can
test the whole protocol shutdown code... :)
1999-02-13 20:15:36 +00:00
Martin Mares
1a54b1c6ac Implemented real cleanup and pruning of routing table on protocol shutdown. 1999-02-13 19:15:28 +00:00
Martin Mares
2569bc4073 Fixed bug in FIB_ITERATE_END: it assumed the control variable is named
"z". I've added an argument specifying name of the variable.

Renamed "again" label in FIB_ITERATE_* to "fis_again" to avoid name
clashes.
1999-02-13 19:13:51 +00:00
Martin Mares
4e9498cbb1 config->router_id works again. 1999-02-13 18:42:00 +00:00
Martin Mares
67bd949a52 Real implementation of protocol state machines. Delayed startup/shutdown
should work now. Initial feeding of protocols by interfaces/routes is
done from the event queue to prevent unwanted recursion.
1999-02-11 22:59:06 +00:00
Martin Mares
64011f898c struct proto again contains instance name (a copy of proto->cf->name). 1999-02-11 22:45:54 +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
Pavel Machek
77cedad1f6 Keep protocol data out of iface_patt. 1999-01-12 16:41:34 +00:00
Martin Mares
18fff6a197 Initialize only protocols which are compiled in :) 1999-01-10 00:26:11 +00:00
Martin Mares
49e7e5ee0b New makefiles. Includes support for out-of-source-tree builds. 1999-01-10 00:18:32 +00:00
Pavel Machek
1d7c44b711 Oops, previous modification for passing NULL to fib_init() did not
compile :-(.
1998-12-22 19:20:43 +00:00
Pavel Machek
ce45fc1287 Allow NULL to init_fib(). 1998-12-22 18:55:49 +00:00
Martin Mares
08c69a7720 die() -> bug() where appropriate. 1998-12-20 14:27:37 +00:00
Martin Mares
e440395d7d When printing a routing table, fib_check() it. 1998-12-20 14:01:37 +00:00
Martin Mares
3ab001b974 Rewrote fib functions to make them insert/delete/asynchronous-walk safe.
This is implemented in a way similar to lib/slists.h, but it took some
more effort to make rehashing not disturb the readers. We do it by just
taking _highest_ k bits of ipa_hash as our hash value and sorting each
box by whole ipa_hash().

Consult FIB_ITERATE_* macros in nest/route.h.

Implemented fib_check() debugging function and also rewrote the rehashing
algorithm to use better thresholds and not to waste time by rehashing
forth and back.
1998-12-20 14:01:20 +00:00
Martin Mares
618533af91 Added source RTS_DUMMY for temporary routes. They should never appear
in the main table.
1998-12-08 18:30:35 +00:00