0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-08 20:28:43 +00:00
Commit Graph

2760 Commits

Author SHA1 Message Date
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
a6f250f5c6 New hash functions according to benchmarks posted yesterday. (The IPv6
version has not been benchmarked yet due to insufficient test data.)
Now ipa_hash() returns a uniformely distributed 16-bit value.
1998-12-20 13:57:49 +00:00
Martin Mares
a05406e69c Implemented deletion/insertion/asynchronous-walk lists.
For example of their use, look at comments in lib/slists.h.
1998-12-20 13:56:27 +00:00
Martin Mares
29ad2c9ee1 Variance estimation fixed. 1998-12-19 21:53:28 +00:00
Martin Mares
87b60bf7e8 Added several tools for fib hashing function analysis. It turned out
we can use very simple function which is monotonic with respect
to re-hashing:

	n ^= n >> 16;
	n ^= n << 10;
	h = (n >> (16 - o)) & ((1 << o) - 1);

where o is table order. Statistical analysis for both backbone routing
table and local OSPF routing tables gives values near theoretical
optimum for uniform distribution (see ips.c for formulae).

The trick is very simple: We always calculate a 16-bit hash value n and
use o most significant bits (this gives us monotonity wrt. rehashing
if we sort the chains by the value of n). The first shift/xor pair
reduces the IP address to a 16-bit one, the second pair makes higher
bits of the 16-bit value uniformly distributed even for tables containing
lots of long prefixes (typical interior routing case with 24-bit or even
longer prefixes).
1998-12-19 11:51:47 +00:00
Pavel Machek
02933ddbbe debug() -> DBG() in rip. 1998-12-09 20:08:57 +00:00
Pavel Machek
06fa1453cd Initial multicast support (can not work, but skeleton is there) 1998-12-09 15:22:40 +00:00
Martin Mares
8e66a0ebb9 Hopefully finished kernel syncer (krt) rewrite:
o  Interface syncing is now a part of krt and it can have configurable
     parameters. Actually, the only one is scan rate now :)
  o  Kernel routing table syncing is now synchronized with interface
     syncing (we need the most recent version of the interface list
     to prevent lots of routes to non-existent destinations from
     appearing). Instead of its own timer, we just check if it's
     route scan time after each iface list scan.
  o  Syncing of device routes implemented.
  o  CONFIG_AUTO_ROUTES should control syncing of automatic device routes.
  o  Rewrote krt_remove_route() to really remove routes :)
  o  Better diagnostics.
  o  Fixed a couple of bugs.
1998-12-08 18:37:58 +00:00
Martin Mares
980297d289 Fixed a couple of bugs in static protocol. All static routes except device
ones seem to work well.
1998-12-08 18:31:31 +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
f39e4713c2 Rewritten kernel syncer. Now uses the rta trickery I've introduced yesterday
and does things "the right way". Few things are still missing (device
routes etc.), I'll add them later in the evening.
1998-12-08 16:20:13 +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
cdc6bfa70f Comparison of kernel reject routes fixed. 1998-12-07 10:16: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
f6bd206607 All static routes except for device ones should work and appear/disappear
when their destination comes on/off link. Deserves better testing :)

See example in bird.conf.
1998-12-06 23:13:31 +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
Martin Mares
436965d25e Aesthetic fix for neighbor cache debug dump. 1998-12-06 23:11:18 +00:00
Martin Mares
89d2355d3d Added new rule for prefix length / netmask. 1998-12-06 23:10:45 +00:00
Martin Mares
cc12cf05c7 cf_error() now accepts any format strings instead of just an error
message. Also added extra kludge to get rid of collisions of REJECT
symbols.
1998-12-06 23:10:28 +00:00
Martin Mares
a1bf6440b5 Added skeleton of static route protocol. 1998-12-06 18:21:23 +00:00
Martin Mares
980ffedbb0 Kernel syncer is now configurable. It will probably need some more
options, but at least basic tuning is possible now.
1998-12-06 17:40:42 +00:00
Martin Mares
0846203e89 Fixed bug in CF_ADDTO. How it's possible it has ever worked? 1998-12-06 17:39:08 +00:00
Martin Mares
166b9c4912 Added rule "bool" for boolean switches. 1998-12-06 17:38:42 +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
Pavel Machek
2d9290e973 Rip now has configurable per-interface metric (please rewiev), and few
more configurable parameters. To do that, union was added into iface_patt.
1998-12-04 11:45:51 +00:00
Pavel Machek
9b999c393c Infinity is now configurable ammount. 1998-12-01 16:17:10 +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
66efdf962a Handle disabled protocol instances. 1998-11-29 22:01:33 +00:00
Martin Mares
ed45f2e126 Added functions for manipulating interface name pattern lists:
o  iface_patt_match(list, iface) -- match interface against list
   o  iface_patts_equal(a, b, c) -- compare whether two pattern lists are
      equal or not. c(x,y) is called for comparison of protocol-dependent
      data.
1998-11-29 22:01:03 +00:00
Martin Mares
49e4a4d1fd Created new functions for allocating configuration data:
o  cfg_alloc(size) -- generic memory allocation
   o  cfg_allocu(size) -- unaligned memory allocation
   o  cfg_allocz(size) -- zeroed memory allocation
   o  cfg_strcpy(str) -- allocate a copy of a string

Also fixed a bug in lexing of string literals.
1998-11-29 21:59:37 +00:00
Martin Mares
5cd462f291 wc -l TODO decreased. 1998-11-29 14:51:47 +00:00
Martin Mares
dee929d868 Added function for shell-like pattern matching. Will be used for
matching interface names in protocol-to-iface bindings.
1998-11-29 14:47:24 +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
0cf86f0fc3 Renamed DEBUG' symbol to DEBUGGING' to prevent collisions with token
names and include files.
1998-11-29 14:38:34 +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
93fb60d54c Fixed few misspellings and exported instance init as rip_init_instance(). 1998-11-27 21:08:37 +00:00
Martin Mares
8450be97d6 Added generator of default names. 1998-11-27 21:07:02 +00:00
Martin Mares
906b0170a4 Experimental config file. 1998-11-27 19:39:16 +00:00
Martin Mares
b4712244a0 Dummy grammar for RIP configuration. Now empty, but must be here since
it's referenced in the makefiles.
1998-11-27 19:38:30 +00:00
Martin Mares
da87782278 Parser fragment for the core. Now handles only router ID setting. 1998-11-27 19:37:57 +00:00
Martin Mares
70591fa064 Compile and use the new configuration code by default. 1998-11-27 19:37:07 +00:00
Martin Mares
f142750d34 Base of the parser. 1998-11-27 19:36:06 +00:00
Martin Mares
82fc7be7bb Lexical analyser. 1998-11-27 19:35:50 +00:00
Martin Mares
fe7cec12e8 Replaced nest/confile.h by conf/conf.h, added a lot of new definitions. 1998-11-27 19:35:10 +00:00
Martin Mares
ce6ca80926 This script takes configuration fragments and generates full Bison grammar
from them.
1998-11-27 19:33:53 +00:00
Martin Mares
882c588a40 This script takes configuration fragments and extracts keyword list
from them.
1998-11-27 19:33:26 +00:00
Martin Mares
d2ed2579fa Now merges configuration fragments (*.Y) as well. 1998-11-27 19:31:41 +00:00