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

int rtnl_link_name2i ( struct nl_cache *  cache,
const char *  name 

Translate a link name to the corresponding interface index

  • cache link cache
  • name link name
interface index or RTNL_LINK_NOT_FOUND if no match was found.

Definition at line 864 of file link.c.

References rtnl_link_get_by_name(), RTNL_LINK_NOT_FOUND, and rtnl_link_put().

      int ifindex = RTNL_LINK_NOT_FOUND;
      struct rtnl_link *link;
      link = rtnl_link_get_by_name(cache, name);
      if (link) {
            ifindex = link->l_index;

      return ifindex;

Generated by  Doxygen 1.6.0   Back to index