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

char* rtnl_link_i2name ( struct nl_cache *  cache,
int  ifindex,
char *  dst,
size_t  len 
)

Translate an interface index to the corresponding link name

  • cache link cache
  • ifindex link interface index
  • dst destination buffer
  • len length of destination buffer
Translates the specified interface index to the corresponding link name and stores the name in the destination buffer.

Returns:
link name or NULL if no match was found.

Definition at line 981 of file link.c.

References rtnl_link_get().

{
      struct rtnl_link *link = rtnl_link_get(cache, ifindex);

      if (link) {
            strncpy(dst, link->l_name, len - 1);
            rtnl_link_put(link);
            return dst;
      }

      return NULL;
}


Generated by  Doxygen 1.6.0   Back to index