Francisco Rodriguez wrote:
> The next step that I'm looking to do is to access the RIB database. I'm not
> 100% sure if accessing to the RIB has to be done through the use of XRLs or
> not. For this, I'm planning to write an application (I guess a sort of XORP
> Process) which needs to have the capability to speak to XORP processes, in
> this case the RIB, and that make other tasks no related with XORP. Any
> insight that you could give me to start this will be much appreciated. 
>   

I recommend you use XRL. There is a "RIB direct" interface but that is
in there largely as a backdoor for testing purposes and I would not
condone its use for new code, but for a prototype it may be much easier
for you to use.

Watch for asynchronicity. All 'Xrl*Client' class 'send*' methods require
that you pass a callback parameter and yes these things may happen
asynchronously, it's RPC after all.

At the moment XRL is best called from C++. Certainly all the client
bindings depend upon it.

It is a tricky problem to solve unless you reimplement libxipc in a
language other than C++, because the XRL sender classes require XORP
event loop and callback semantics. These expect C++ linkage i.e. the
instance you pass to it must be derived from XorpCallback.

How we deal with this in shell scripts, is just to use the call_xrl
tool, however this obviously means you block waiting for each XRL call
to execute, and it also doesn't let you implement XRL targets outside of
C++.

I tried to solve this in SWIG the other day, but I can't get my head
around how to write typemaps at the level of wrapping we require (ie
references to callback types). Hint: XRL targets themselves are actually
easy enough to wrap in SWIG-- you just need to instantiate an
XrlStdRouter from outside and pass that in.

Clients are harder because of asynchronicity.

Someone really needs to sit down and solve the scripting language
wrapper problem.

What would be really cool is if someone slapped together a Bouml plug-in
and plug-out which allows XORP XIF RPC specifications to be expressed in
UML. I think you can even do this in Python now.

This shouldn't be too difficult as the XIF syntax is C-like and the
grammar isn't at all complex, and it will let you visualize the XIF
interfaces as... nice shiny standard diagrams.

cheers
BMS

_______________________________________________
Xorp-hackers mailing list
[email protected]
http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers

Reply via email to