Re[2]: A couple of questions about flnl_lookup() function.

Gavrilenko Eugene zhenya48.80 at mail.ru
Tue Mar 27 22:42:13 EDT 2012


Thank you for your explanations about 'next-hop-selector' and multi-path routing.

I think I need to describe my task in more details.
I need to implement some kind of virtual routing system (like VRF) in user space. 
It will consist of several routing tables and must perform basic operations on this tables, such as 'add route', 'remove route', 'find next hop' and so on.
But I couldn't find any implementation of routing subsystem in user space!
Therefore I decided to use native Linux routing subsystem.

As I figure out Netlink have full information about next-hop (in fib_result->fi->fib_nh[nh_sel]) in nl_fib_lookup(), but copies to reply  message next hop selector only. 
It seems I need to implement my own netlink protocol with my own message's type to perform FIB lookup.
I think I need to write my own kernel module which will call fib_table_lookup() directly, but will copy full info about next hop to reply.
Is it right? Or, may be, you know a better solution?

Best regards!


More information about the libnl mailing list