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

struct rtnl_link* rtnl_link_get_by_name ( struct nl_cache *  cache,
const char *  name 
) [read]

Look up link by link name in the provided cache

  • cache link cache
  • name link name
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 818 of file link.c.

References nl_object_get().

Referenced by rtnl_link_name2i().

{
      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 (!strcmp(name, link->l_name)) {
                  nl_object_get((struct nl_object *) link);
                  return link;
            }
      }

      return NULL;
}


Generated by  Doxygen 1.6.0   Back to index