Commit graph

2323 commits

Author SHA1 Message Date
Martin Mares
f5c687f791 Added lp_flush() which flushes contents of a linear pool, leaving all the
memory available for subsequent allocations from the same pool. Both flushing
and re-using the memory costs just few instructions.
1999-03-29 19:35:47 +00:00
Martin Mares
f54801ffed Moved all system-dependent #include's containing endianity conversion
functions to sysdep header endian.h.
1999-03-29 19:14:43 +00:00
Martin Mares
6134024815 #define NULL if not defined by system includes. 1999-03-29 19:13:36 +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
1127ac6ec7 Cleaned up system configuration files -- removed few obsolete parameters,
documented the remaining ones (sysdep/cf/README).

Available configurations:

   o  linux-20: Old Linux interface via /proc/net/route (selected by default
		on pre-2.1 kernels).
   o  linux-21: Old Linux interface, but device routes handled by the
		kernel (selected by default for 2.1 and newer kernels).
   o  linux-22: Linux with Netlink (I play with it a lot yet, so it isn't
		a default).
   o  linux-ipv6: Prototype config for IPv6 on Linux. Not functional yet.
1999-03-27 22:51:05 +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
241b7311ec Don't compile OSPF by default. 1999-03-26 21:35:28 +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
f79a749d0b Removed our declaration of RTPROT_BIRD since Alexey has assigned
us a real protocol number in 2.2.4 kernel.
1999-03-24 09:23:34 +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
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
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
Pavel Machek
9a38757c6a Initialize pointers to functions so that code is actually alive. 1999-03-17 13:05:25 +00:00
Pavel Machek
3c7ad64c57 Compilation fix for mj. 1999-03-17 13:04:33 +00:00
Pavel Machek
29df5739c4 Don't segfault on unknown interface. 1999-03-17 10:20:23 +00:00
Pavel Machek
d36d838df5 accept & reject should now work 1999-03-17 10:19:07 +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
Pavel Machek
2575593e0f Resolved conflicts, you no longer need to wrap constants in const() 1999-03-09 14:45:27 +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
111213f0b6 Fixed processing of !krt_capable() routes. Converted device route decisions
to the krt_capable mechanism as well.
1999-03-04 19:00:31 +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
2253c9e239 Although there are still heaps of FIXME's, Netlink works.
To build BIRD with Netlink support, just configure it with

	./configure --with-sysconfig=linux-21

After it will be tested well enough, I'll probably make it a default
for 2.2 kernels (and rename it to linux-22 :)).
1999-03-04 14:23:32 +00:00
Martin Mares
f81dc8564a Converted some mb_alloc/bzero pairs to mb_allocz. 1999-03-04 11:40:05 +00:00
Martin Mares
8fe48f1377 Initialize allocated struct proto :-) 1999-03-04 11:39:24 +00:00
Martin Mares
7a2105becd Use dmalloc instead of EFence when available (dmalloc has lot of improvements
over EFence and also hopefully smaller memory overhead, but sadly it's non-free
for commercial use).

If the DMALLOC_OPTIONS environment variable is not set, switch on `reasonable'
checks by default.

Also introduced mb_allocz() for cleared mb_alloc().
1999-03-04 11:36:26 +00:00
Martin Mares
aa64578641 Netlink scans routes... 1999-03-03 20:57:29 +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
2d14045224 Rewrote the kernel syncer. The old layering was horrible.
The new kernel syncer is cleanly split between generic UNIX module
and OS dependent submodules:

  -  krt.c (the generic part)
  -  krt-iface (low-level functions for interface handling)
  -  krt-scan (low-level functions for routing table scanning)
  -  krt-set (low-level functions for setting of kernel routes)

krt-set and krt-iface are common for all BSD-like Unices, krt-scan is heavily
system dependent (most Unices require /dev/kmem parsing, Linux uses /proc),
Netlink substitues all three modules.

We expect each UNIX port supports kernel routing table scanning, kernel
interface table scanning, kernel route manipulation and possibly also
asynchronous event notifications (new route, interface state change;
not implemented yet) and build the KRT protocol on the top of these
primitive operations.
1999-03-03 19:49:56 +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
Pavel Machek
84c7e1943f Add interface for running filters (please comment!), avoid bison warnings 1999-03-02 19:49:28 +00:00
Pavel Machek
05a845ed8e Avoid segfault 1999-03-02 19:49:22 +00:00
Martin Mares
7972248d5d Netlink module supports interface scan on startup. Working on more. 1999-03-02 18:37:02 +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
25287d6f7e Don't try to install static routes to disconnected neighbors. 1999-03-02 17:20:07 +00:00
Martin Mares
eab0d1e5e5 Latest changes broke out-of-tree compilation. 1999-03-02 16:39:41 +00:00
Pavel Machek
3d8ef0c9ef I just don't like files enclosed in <>. 1999-03-02 13:15:35 +00:00
Martin Mares
e834074dd4 If we are compiling with debugging enabled and libefence is available,
link it to get debugging malloc.
1999-03-01 22:42:47 +00:00
Martin Mares
b982b6db2b Implemented netlink protocol parsing functions. More to come tomorrow. 1999-03-01 22:31:27 +00:00
Martin Mares
b4b3b39e20 Added SK_MAGIC type sockets for internal use by system dependent code,
especially for netlink communication.
1999-03-01 22:30:33 +00:00
Pavel Machek
c748cdb9ec Hopefully ended translating to new interface 1999-03-01 21:18:01 +00:00
Martin Mares
bdb95a21a4 Added skeletal version of Linux netlink interface. It doesn't work yet,
but the framework is there and I'll try finish it soon.
1999-03-01 20:17:46 +00:00