Cache the interfaces and do a foreach in result

Thomas Graf tgraf at
Thu Dec 15 07:12:29 EST 2011

On Wed, Dec 14, 2011 at 05:12:32PM +0200, Adrian Ban wrote:
> Hi,
> I want do a "foreach" through the cached interface list and return
> some information. I've took a look into nl-link-list.c source, but
> that file uses a function nl_cache_dump_filter defined in library.
> The nl_list_for_each_entry I can't use it because it tries to access
> some struct fields from nl_cache for example. In libnl it uses the
> netlink-types.h and netlink-local.h headers which are not added in
> headers on machine.
> There is another way to do a such "foreach" ?

nl_cache_foreach() and nl_cache_foreach_filter()

More information about the libnl mailing list