rtnl_link_get_kernel()

Wouter Verhelst w at uter.be
Mon Jul 9 12:14:43 EDT 2012


On Mon, Jul 09, 2012 at 03:17:19AM -0400, Thomas Graf wrote:
> On Sun, Jul 08, 2012 at 08:14:42PM -0600, Wouter Verhelst wrote:
> > On Fri, Jul 06, 2012 at 04:51:01PM -0600, Wouter Verhelst wrote:
> > > What I've not been able to do yet, however, is read the assigned IP
> > > address(es) to a particular interface. There's rtnl_addr_get(), but
> > > that wants a cache (which I'm not using). There's rtnl_link_inet_get_conf(),
> > > but that doesn't seem to be dealing with IP addresses unless I'm
> > > terribly mistaken.
> > > 
> > > What am I missing?
> > 
> > Anyone?
> 
> Please respect that people don't work weekends.

Sorry, I hadn't noticed it was weekend (I'm at DebConf; losing track of
time is fairly easy).

> You need to allocate an address cache using rtnl_addr_alloc_cache()
> and then search it using rtnl_addr_get() or iterate over it using
> nl_cache_foreach()

Yes, if I do use the cache it's easy. But since I want to do my own
cache management, I had preferred not doing it that way.

Do you mean to say that's not possible with libnl?

-- 
The volume of a pizza of thickness a and radius z can be described by
the following formula:

pi zz a



More information about the libnl mailing list