How can I get the default gateway with libnl

Loïc Touraine ltouraine at envivio.com
Thu Aug 9 08:38:44 EDT 2012


Hello,
Everthing is in the subject :
I need to figure out several things with libnl-route :

-          Get the default route gateway

-          Get the gateways for each link on the computer

I  tried using struct rtnl_nexthop * nhop = rtnl_route_nexthop_n (route,0);
I saw the first nhop doesn't contain gateway infos, but it seems the next nhop inside the returned nhop does have a gateway declared.

In fact, what I actually miss is some documentation around the new routing API :).

Any help appreciated,
Kind regards Loïc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20120809/745835e4/attachment.html>


More information about the libnl mailing list