Commit graph

3949 commits

Author SHA1 Message Date
Pavel Machek feb6abe009 RIP now actually talks to itself. 1998-10-20 16:12:43 +00:00
Martin Mares 8ca8683c70 Beware the NULL route, my son... The bugs that bite, the BIRDs that crash :-) 1998-10-20 15:47:02 +00:00
Martin Mares acc62f5e1d Insert/remove hooks return void, not int. 1998-10-20 15:17:38 +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 b6903c948b Updated TODO. 1998-10-19 18:18:12 +00:00
Martin Mares 7d83290780 Generate router_id automatically if possible (standard "smallest of local
regular interface addresses" rule).

Protocols should NOT rely on router_id existence -- when router ID is not
available, the router_id variable is set to zero and protocols requiring
valid router ID should just refuse to start, reporting such error to the log.
1998-10-19 18:13:36 +00:00
Martin Mares 0804525255 Basic kernel routing table syncing implemented. Learning of routes installed
by other programs or the kernel itself is not supported yet, but it's not
needed for development of other protocols.
1998-10-19 17:52:29 +00:00
Martin Mares 567e6c6220 Use (SOCK_DGRAM,IPPROTO_IP) socket instead of (SOCK_STREAM,IPPROTO_TCP).
This is exactly what Linux ifconfig does and seems to be the preferred way.
1998-10-19 17:48:45 +00:00
Martin Mares 4cf45766ba Exporting fill_in_sockaddr() for use by other unix-dependent code. 1998-10-19 17:47:50 +00:00
Martin Mares 36f2caf147 Fixed generation of device routes for unnumbered point-to-point links. 1998-10-19 17:46:45 +00:00
Martin Mares f184ea6f7e Proto struct now contain (down | starting | up) state. 1998-10-19 17:45:29 +00:00
Martin Mares 16a8ba30a9 We parse /proc/net/route and flag RT entries according to it. More to come
today in the morning...
1998-10-18 22:25:56 +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 ab3a76a382 Added ipa_from_u32 and ipa_from_u32 for use in the kernel sync code (IPv4 only).
Don't ever think of using it in routing protocols.
1998-10-18 22:22:28 +00:00
Martin Mares 7e7790c61f Since almost every UNIX system requires different techniques for reading
the kernel routing table as opposed to modifying it which is approximately
the same on non-netlink systems, I've split the kernel routing table
routines to read and write parts. To be implemented later ;-)
1998-10-18 12:50:43 +00:00
Martin Mares 8b1688177b * Please distinguish between DGB() and debug(). 1998-10-18 12:48:15 +00:00
Martin Mares 3629bcf0c7 Preconfig, postconfig and init hooks can be NULL. 1998-10-18 12:26:02 +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 05e56feb57 Removed global pointer to proto_dev. 1998-10-18 11:50:36 +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 570ce189d7 Implemented `route last modified' time. 1998-10-18 10:49:46 +00:00
Martin Mares 2a900b1b15 Fixed misleading comment. 1998-10-17 11:26:28 +00:00
Martin Mares 7f3d198df1 Each protocol now hears even its own routes and needs to make its own
loop detection. This is needed since both RIP and OSPF handle multiple
neighbors and they need to redistribute routes learned from each neighbor
to the remaining ones.
1998-10-17 11:24:13 +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 d92882be9b WALK_LIST_DELSAFE now actually works (it really couldn't since it didn't
reference list head at all).
1998-10-17 11:02:39 +00:00
Pavel Machek c05ea56f8e rip should now correctly listen, but entries will not time out. 1998-10-17 10:25:22 +00:00
Pavel Machek 8333431c4d Rip: rip_rta_same added. 1998-10-15 15:12:24 +00:00
Martin Mares 93f1c532e9 Moved scanning of interfaces, so that they get initialized after all
routing protocol instances.
1998-10-14 13:38:17 +00:00
Pavel Machek cf3934c569 Lists: unneccessary test killed, make code friendly to non-gcc. 1998-10-14 13:27:53 +00:00
Martin Mares c93214d442 o There are cases when SIOCGIFINDEX is defined, but it doesn't work. When
this happens, don't reject the whole interface, just mark it as index 0.
o  Removed Pavel's comment about EFAULT and SIGSEGV. EFAULT is a valid return
   code for cases where the buffer is too small.
o  Commented out the smart interface list size logic temporarily as it seems
   Linux 2.0 SIOCGIFCONF doesn't react to ifc_req==NULL sanely. Replaced it
   by exponential stepping.
1998-10-13 19:57:33 +00:00
Pavel Machek fdf33cde1c Strange, on atrey ioctl() does not fill structure, and bird segfaults
on it. Now we "only" die().
1998-10-13 14:59:46 +00:00
Pavel Machek 21580e304f I prefer to have broken drivers than completely stupid ones...
Linus Torvalds

Rip now uses main routing table properly: entries are stored directly
into main routing table and we are relying on core to call our's
compare. That unfortunately broke garbage collecting (and probably
many more things). It compiles.
1998-10-13 14:32:18 +00:00
Pavel Machek 1d941de47a RIP now somehow listens to main routing table (dont expect it to work) 1998-10-07 19:33:50 +00:00
Martin Mares 8c43696da0 Route update hook now gets network prefix as well as updated
route attributes.
1998-08-31 21:13:42 +00:00
Pavel Machek bf65d27dea Bird's info are now understood by ripquery. 1998-07-30 07:43:45 +00:00
Pavel Machek 279f4c7b7b Rip now includes code to reply, but it is currently broken. 1998-07-28 21:44:11 +00:00
Pavel Machek 48b41d5811 Do not segfault on iface == NULL. 1998-07-28 21:42:08 +00:00
Pavel Machek a872b0f7da Reversed buggy patch. 1998-07-20 20:05:40 +00:00
Martin Mares c25e90efed Added comment explaining `now'. 1998-07-15 19:42:23 +00:00
Martin Mares 1be52eea57 Removed format specification attributes for log() and debug() until
GCC is fixed to handle custom formats.
1998-07-10 08:39:34 +00:00
Martin Mares 786d0bb9e7 Added ipa_class_mask() which guesses netmask for classful addressing.
For pure A/B/C class addresses it just returns the class netmask, for
subnets it tries to guess subnet mask. Please make sure the address
you pass to this function is really a valid host address (i.e., call
ipa_validate() first).
1998-07-10 08:38:29 +00:00
Martin Mares 28a9a189d7 Replaced remaining references of clock_t by bird_clock_t. 1998-07-10 08:32:18 +00:00
Pavel Machek a103373f61 Commiting RIP. RIP should somehow listen, will not reply. I needed to
commit it so that whole thing compiles.
1998-07-09 19:39:04 +00:00
Pavel Machek 86b0023033 Making SIGUSR1 dump also all protocols. 1998-07-09 19:37:39 +00:00
Pavel Machek 87d2be86e5 Adding proto_dump_all() function 1998-07-09 19:36:52 +00:00
Pavel Machek cf3527e2f4 Adding MIN()/MAX() macros 1998-07-09 19:36:05 +00:00
Pavel Machek aea2dcabdc Adding walk list which permits you to delete entries. 1998-07-09 19:35:23 +00:00
Martin Mares 962ba482fd Use '%I' instead of dirty address printing hacks. 1998-06-17 14:36:02 +00:00
Martin Mares d997534f65 Oops, forgot '%m'... 1998-06-17 14:34:13 +00:00
Martin Mares 9556f22585 debug() and log() use the new printf. Feel free to use new formatting
sequences for all output.
1998-06-17 14:33:29 +00:00