Reconfiguration for device protocol.
Converted shutdown to a kind of reconfiguration, it's no more handledas a exception in protocol state machines. Introduced a `shutdown'CLI command. Killed few reconfiguration bugs.
First attempt on dynamic reconfiguration. There are still lots of bugsand problems to solve, but the hardest part works.
Handle cases when SIOCGIFINDEX is defined, but doesn't work (new glibcwith 2.0 kernels).
Better order of includes.
set_inaddr() moved to sysio.h.
Tried to clean up multicast handling. Now we don't try to guessmulticast abilities depending on definedness of symbols and use hard-wiredsystem-dependent configuration defines instead.
Please test whereever you can.
Added universal locking mechanism which will solve problemswith protocols wanting to use the same port on the same interfaceduring reconfiguration time.
How to use locks: In the if_notify hook, just order locks for theinterfaces you want to work with and do the real socket opening after the...
Temporary work-arounds for multicast problems. Needs further investigation.
Except for special protocols (nowadays only the kernel syncer), don'texport host and link scope routes.
- Path to control socket is selectable via command-line option.- die() when control socket open failed.
Allow logging to stderr as well.
Logging is now configurable. You can define multiple log outputs (to bothfiles and syslog) and assign lists of message categories to each of them.
Added tracked_fopen() which is a fopen registered in resource database.Will be used for log files.
Implemented echoing of log messages to CLI connections. Just try `echo all'.
Added tm_format_reltime() for formatting of relative time quantities.
Moved TIME_INFINITY to timer.h, so that it's publicly available.
If the main event queue is not empty, call select() with zero timeout, sothat the events are ran again after the FD's are checked. This allows usto schedule I/O checks between processing of user commands.
Renamed attr->attrs to attr->eattrs.
The CLI I/O functions work as desired.
First steps of the Command Line Interface: I/O routines.
Implemented unix-domain sockets.
Configure PATH_CONTROL_SOCKET.autoconf.h is now written to obj/sysdep, the source tree is hopefullycompletely read-only now.
Added skeleton of the client. Does nothing, but at least compiles.
Failure to set socket TOS is not a fatal error.
Added a function for generating 32-bit random numbers.
Taught Netlink how to behave in IPv6 world.
Support for IPv6 sockets. How nice one doesn't have to ifdef aroundten years of API evolution :-)
Basic support for IPv6. The system-dependent part doesn't work yet,but the core routines are there and seem to be working.
o lib/ipv6.[ch] written o Lexical analyser recognizes IPv6 addresses and when in IPv6 mode, treats pure IPv4 addresses as router IDs....
Kernel route syncer supports multiple tables.
The changes are just too extensive for lazy me to list themthere, but see the comment at the top of sysdep/unix/krt.c.The code got a bit more ifdeffy than I'd like, though.
Also fixed a bunch of FIXME's and added a couple of others. :)
Changes to interface handling on traditional Unices:
o Aliases are interpreted as secondary addresses. o When the system doesn't supply interface indices, generate our ones.
Added functions for parsing and formatting of dates.
Grrr, the "obvious fix" to multicasting code from yesterday wasfundamentally wrong. Reversed.
Fix potential multicasting bug.
Added extra argument to rt_update hook which contains a pointer to thetemporary attribute list.
Added CONFIG_MULTIPLE_TABLES whereever appropriate.
Removed one unused structure field.
Kill remaining master_table relics in KRT code.
Make all protocols pass routing table to rte_update and rte_discard.
Netlink support for secondary interface addresses.
I rewrote the interface handling code, so that it supports multipleaddresses per interface (needed for example for IPv6 support).
o struct iface now contains a list of all interface addresses (represented by struct ifa), iface->addr points to the primary address (if any)....
Multicasts once again: When using SO_BINDTODEVICE, don't specify IP addressof the interface.
Next attempt to get SO_BINDTODEVICE work :)
Use SO_BINDTODEVICE if we're using old multicast API (i.e., struct ip_mreqand not ip_mreqn). This should get multicasts on unnumbered PtP links work.
Ignore alias interfaces (some day, we will treat them as pure secondaryinterface addresses).
Removed TOS support. This simplifies many things a lot.
Use `struct ip_mreqn' instead of `struct ip_mreq' for multicastoperations on 2.1/2.2 kernels. This allows passing of real interfaceindexes instead of referencing interfaces by their IP addresses whichfails badly in presence of unnumbered interfaces.
Unfortunately, this structure is not visible with glibc 2.0 as it provides...
Fixed a couple of bugs in handling of multicast sockets.
See comments in lib/socket.h for a detailed guide on how to use them.
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...
Defined CONFIG_SELF_CONSCIOUS whenever the kernel scanner is ableto distinguish between our own routes and alien ones.
Fixed `too many interfaces' cases.
Believe it or not, printf()'s does not work too much without this one.
Argh, the fix was wrong.
First few FreeBSD portability fixes.
Remember that we can run device syncer without kernel syncerand vice versa now.
Clarify resource dumps and include them in the main debugging dump.
Don't try to delete interface routes on CONFIG_AUTO_ROUTES systems.
Moved all system-dependent #include's containing endianity conversionfunctions to sysdep header endian.h.
Cleaned up system configuration files -- removed few obsolete parameters,documented the remaining ones (sysdep/cf/README).
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...
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...
Removed our declaration of RTPROT_BIRD since Alexey has assignedus a real protocol number in 2.2.4 kernel.
Fixed processing of !krt_capable() routes. Converted device route decisionsto the krt_capable mechanism as well.
KRT: Implemented asynchronous route / interface state notifications(via Netlink). Tweaked kernel synchronization rules a bit. Discoveredlocking bug in kernel Netlink :-)
Future plans: Hunt all the bugs and solve all the FIXME's.
Although there are still heaps of FIXME's, Netlink works.
To build BIRD with Netlink support, just configure it with
After it will be tested well enough, I'll probably make it a defaultfor 2.2 kernels (and rename it to linux-22 :)).
Converted some mb_alloc/bzero pairs to mb_allocz.
Use dmalloc instead of EFence when available (dmalloc has lot of improvementsover EFence and also hopefully smaller memory overhead, but sadly it's non-freefor commercial use).
If the DMALLOC_OPTIONS environment variable is not set, switch on `reasonable'...
Netlink scans routes...
Fix several things I broke today.
Rewrote the kernel syncer. The old layering was horrible.
The new kernel syncer is cleanly split between generic UNIX moduleand 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)...
Netlink module supports interface scan on startup. Working on more.
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(),...
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....
Implemented netlink protocol parsing functions. More to come tomorrow.
Added SK_MAGIC type sockets for internal use by system dependent code,especially for netlink communication.
Added skeletal version of Linux netlink interface. It doesn't work yet,but the framework is there and I'll try finish it soon.
Include "config.h" instead of "autoconf.h" in all Modules lists to make definesin the static portion of configuration includes available as well.
Use traditional Unix route/iface interface only when CONFIG_NETLINKis not defined. Also moved declarations of Unix iface logic to krt.h.
When shutting down, remove all routes (except for RTS_INHERIT and RTS_DEVICEroutes) from kernel routing tables unless the "persist" switch is set.
Moved sanity check of protocol state during annoucements to rte_announce.
Perform gracious shutdown upon receipt of SIGTERM. Finally we cantest the whole protocol shutdown code... :)
Squashed one bug in timing of route scans.
Synchronize signals to the main select/event/timer loop.
Parse command line options.
config->router_id works again.
Run the event queue before writing SIGUSR dumps.
Added simple event scheduling system to avoid recursive callingof various callbacks.
Events are just another resource type objects (thus automatically freedand unlinked when the protocol using them shuts down). Each event canbe linked in at most one event list. For most purposes, just use the...
Synced Linux sysdeps to new interface.
Synced kernel interface to new interface.
Implemented new configuration/reconfiguration interface and defined protocolstate machines. Full explanation will follow soon.
filters_init() renamed to filters_postconfig().
Filters, second try. This time they have their own directory.
Properly initialize filters. Also bumped version to 0.0.0 as itactually does something.
New makefiles. Includes support for out-of-source-tree builds.
First step of "autoconfization". Created a configure script whichguesses most system-dependent parameters and determines name of systemconfiguration file (sysdep/cf/...) with the remaining ones.
To compile BIRD, you now need to do:
autoconf # Create configure from configure.in...
die() -> bug() where appropriate.
Finer grained logging levels:
#define L_DEBUG "\001" /* Debugging messages /#define L_INFO "\002" / Informational messages /#define L_WARN "\003" / Warnings /#define L_ERR "\004" / Errors /#define L_AUTH "\005" / Authorization failed etc. */...
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...
Rewritten kernel syncer. Now uses the rta trickery I've introduced yesterdayand does things "the right way". Few things are still missing (deviceroutes etc.), I'll add them later in the evening.
Comparison of kernel reject routes fixed.