Logo Search packages:      
Sourcecode: libnl version File versions  Download package

struct rtnl_link* rtnl_link_get ( struct nl_cache *  cache,
int  ifindex 
) [read]

Look up link by interface index in the provided cache

  • cache link cache
  • ifindex link interface index
The caller owns a reference on the returned object and must give the object back via rtnl_link_put().

Returns:
pointer to link inside the cache or NULL if no match was found.

Definition at line 674 of file link.c.

References nl_object_get().

Referenced by rtnl_link_i2name().

{
      struct rtnl_link *link;

      if (cache->c_ops != &rtnl_link_ops)
            return NULL;

      nl_list_for_each_entry(link, &cache->c_items, ce_list) {
            if (link->l_index == ifindex) {
                  nl_object_get((struct nl_object *) link);
                  return link;
            }
      }

      return NULL;
}


Generated by  Doxygen 1.6.0   Back to index