Commit graph

121 commits

Author SHA1 Message Date
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
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
Martin Mares
04925e9040 Minor rte/rta interface changes:
o  rte can now contain a pointer to both cached and uncached rta. Protocols
     which don't need their own attribute caching can now just fill-in a rta,
     link it to rte without any calls to attribute cache and call rte_update()
     which will replace rte->attrs by a cached copy.

  o  In order to support this, one of previously pad bytes in struct rta
     now holds new attribute flags (RTAF_CACHED). If you call rte_update()
     with uncached rta, you _must_ clear these flags. In other cases rta_lookup()
     sets it appropriately.

  o  Added rte_free() which is useful when you construct a rte and then the
     circumstances change and you decide not to use it for an update. (Needed
     for temporary rte's in kernel syncer...)
1998-12-07 21:59:15 +00:00
Martin Mares
12df4d909b KRF_* flags moved to krt.h as they are internal to kernel syncer,
fib->pad0,pad1 renamed to x0,x1 and in case of struct net x0 is reserved
for kernel syncing as well.
1998-12-07 10:15:42 +00:00
Martin Mares
78d06cf2bc Removed protocol-specific data in rte for protocol static since no
such data ever existed.
1998-12-06 23:11:47 +00:00
Pavel Machek
feb6abe009 RIP now actually talks to itself. 1998-10-20 16:12:43 +00:00
Martin Mares
a0762910a6 Added pointer to network to RTE. The complications with passing NET separately
aren't worth 4 bytes per RTE.

rte_discard and rte_dump don't need net * as parameter.
1998-10-20 15:13:18 +00:00
Martin Mares
4c45595e3b o FIB flags now available for FIB users.
o  struct network: FIB flags used for kernel syncing.
o  struct network: `next' field deleted (historical relic).
1998-10-18 22:24:41 +00:00
Martin Mares
0432c0173b Split protocol init to building of protocol list and real protocol init.
Added kernel route table syncer skeleton.
1998-10-18 11:53:21 +00:00
Martin Mares
5b22683d2f After contemplating about RIP route timeouts for a long time, I've implemented
protocol callbacks for route insertion and deletion from the central table.
RIP should maintain its own per-protocol queue of existing routes, scan it
periodically and call rte_discard() for routes that have timed out.
1998-10-18 11:13:16 +00:00
Martin Mares
47b793064c Solve chicken-and-egg problems with protocol startup. We now queue all inactive
protocols and don't send route/interface updates to them and when they come up,
we resend the whole route/interface tables privately.

Removed the "scan interface list after protocol start" work-around.
1998-10-17 11:05:18 +00:00
Martin Mares
236d4eb8ce FIB_WALK and friends are now slightly more friendly. 1998-06-04 20:29:44 +00:00
Martin Mares
4cc78c5082 - Rewrote whole interface logic. Removed support for multiple addresses per
interface since it makes much trouble everywhere. Instead, we understand
  secondary addresses as subinterfaces.

- In case interface addresses or basic flags change, we simply convert it
  to a down/up sequence.

- Implemented the universal neighbour cache. (Just forget what did previous
  includes say of neighbour caching, this one is brand new.)
1998-06-01 21:41:11 +00:00
Martin Mares
a2ccbb0b97 Implemented timers. Using bird_clock_t for absolute time from now... 1998-05-24 14:40:29 +00:00
Martin Mares
2326b001d6 Added routing table and routing attribute code. 1998-05-20 11:54:33 +00:00
Martin Mares
62aa008abd Parts of routing table code. Data structure declarations should be
complete now.
1998-05-15 07:54:32 +00:00
Martin Mares
a8b6038225 Next attempt on data structures... 1998-05-03 16:42:45 +00:00
Martin Mares
1feea03e74 Changed #include <x/y> to #include "x/y" for our local includes, so that
gcc -MM can be used to separate them from the system ones.

Added automatic generation of dependencies.
1998-04-28 14:39:34 +00:00
Martin Mares
481f69854a Added few route attributes. 1998-04-23 08:09:39 +00:00
Martin Mares
58ef912c6b First look at data structures. More to come tomorrow... 1998-04-22 12:58:34 +00:00