On Wed, 27 May 2015, Gopakumar Choorakkot Edakkunni wrote:

Hello all,

I was exploring if I can manage to use Quagga OSPFd alone without the
zebra daemons, for reasons below.

1. I have my own RIB/FIB engines and am not interested in the Linux
RIB/FIB tables. So no need of netlink etc..

2. I have my own representations for "interfaces", which are different
from the linux eth0/eth1 etc..

Because of these two reasons, I was exploring for a way by which I can
tell ospfd that

A. here is a list of interfaces, and here is the OSPF config for those
interfaces - the interfaces are not in the standard linux ifindex
format etc.., consider it just as some datastructure which abstracts
the notion of an interface.

The easiest way here would be just to have your code call the zclient callbacks ospfd has registered, and supply the appropriate arguments.

B. When you need to Tx an OSPF packet, call my API my_packet_tx().
Similarly when I get an rx packet, my_packet_rx() will get called
which will then call the OSPF packet Rx APIs.

ospf_network.c, see ospf_write and ospf_read.

The read goes through stream_recv. The write is with sendmsg in two places. You'd also need to 'hijack' the opening of the filedescriptors and the sockopts (at a minimum). Most sockopts should already go through lib/sockopt. You'll probably hit other stuff.

I wouldn't mind making it easier to wrap these so ospfd could be easily 'shimed' (or any other protocol daemon). E.g., I'd like to be able to run some inside a simulator.

It might be useful to create a little library preloadable or maybe with stronger symbols than the libc ones, to catch all OS open/read/write/etc functions that Quagga could use and redirect.

C. And whenever there is a routing table change, give me a callback
with the update - this I guess is already available as OSPF APIs

Again, see the zclient callbacks ospfd has registered - ospfd/ospf_zebra.c and lib/zclient.

For #A and #B, I see that OSPFd relies on the unix/linux notion of
interface/ifindex etc.. and the packet Rx/Tx is via socket() API
calls. So I guess the answer here is that OSPFd is not written to
support this. But I was wondering if anyone else knows of any other
branch/fork of quagga which might achieve this ? This is more like
asking for a "ospfd library" which can be embedded into another
process and the library relies on that process to supply it with
interface abstractions and packet Rx/Tx APIs. Any pointers will be
greatly appreciated !

See above.

I'd be interested in this myself. Could be useful for testing Quagga, and for doing protocol validation.

regards,
--
Paul Jakma      [email protected]  @pjakma Key ID: 64A2FF6A
Fortune:
The young lady had an unusual list,
Linked in part to a structural weakness.
She set no preconditions.

_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to