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.
The CLI I/O functions work as desired.
First steps of the Command Line Interface: I/O routines.
Implemented unix-domain sockets.
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.
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.
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...
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.
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.
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...
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.
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'...
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)...
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....
Added SK_MAGIC type sockets for internal use by system dependent code,especially for netlink communication.
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... :)
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 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.
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.
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 reservedfor kernel syncing as well.
Kernel syncer is now configurable. It will probably need some moreoptions, but at least basic tuning is possible now.
First attempt at protocol configuration (now done only for RIP).
Compile and use the new configuration code by default.
Complain loudly if the logging buffer would overflow.
Generate router_id automatically if possible (standard "smallest of localregular interface addresses" rule).
Protocols should NOT rely on router_id existence -- when router ID is notavailable, the router_id variable is set to zero and protocols requiring...
Basic kernel routing table syncing implemented. Learning of routes installedby other programs or the kernel itself is not supported yet, but it's notneeded for development of other protocols.
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.
Exporting fill_in_sockaddr() for use by other unix-dependent code.
Since almost every UNIX system requires different techniques for readingthe kernel routing table as opposed to modifying it which is approximatelythe same on non-netlink systems, I've split the kernel routing tableroutines to read and write parts. To be implemented later ;-)
Split protocol init to building of protocol list and real protocol init.Added kernel route table syncer skeleton.
Solve chicken-and-egg problems with protocol startup. We now queue all inactiveprotocols 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.
Moved scanning of interfaces, so that they get initialized after allrouting protocol instances.
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....
Strange, on atrey ioctl() does not fill structure, and bird segfaultson it. Now we "only" die().
Added comment explaining `now'.
Replaced remaining references of clock_t by bird_clock_t.
Making SIGUSR1 dump also all protocols.
debug() and log() use the new printf. Feel free to use new formattingsequences for all output.
Fixed processing of timers.