[Babel-users] More about the BSD port

Juliusz Chroboczek Juliusz.Chroboczek at pps.jussieu.fr
Fri Nov 19 14:07:18 UTC 2010


> We just have to think about a good API interface between the routing code and 
> the os-dependent parts.

"Just"?

The interface between system-independent and system-dependent code used
by babeld is defined in

  http://www.pps.jussieu.fr/~jch/software/repos/babeld/kernel.h

You will notice that all functions take both an interface name and
identifier; this makes the interface more efficient, since some kernel
interfaces use the former and some the latter (babel's core keeps track
of both).

You will also notice that there is a callback (kernel_callback) that
notifies the core of changes to the routing table.

There's also a nasty hack, not visible in the interface -- the low-level
code sets a variable "kernel_socket" which is included in the select
system call by the core.  (Yes, that needs to be cleaned up.)

Finally, you'll notice two functions that are not directly related to
networking -- read_random_bytes, which reads /dev/urandom, and gettime,
which returns monotonic time.

The interface used by babelz is defined in

  http://www.pps.jussieu.fr/~jch/software/repos/babelz/kernel.h

and adds one function, kernel_interface_channel.

Enjoy your unification,

                                        Juliusz



More information about the Babel-users mailing list