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

int genl_ctrl_resolve ( struct nl_sock *  sk,
const char *  name 
)

Resolve generic netlink family name to its identifier

  • sk Netlink socket.
  • name Name of generic netlink family
Resolves the generic netlink family name to its identifer and returns it.

Returns:
A positive identifier or a negative error code.

Definition at line 222 of file ctrl.c.

References genl_ctrl_search_by_name(), and nl_cache_free().

{
      struct nl_cache *cache;
      struct genl_family *family;
      int err;

      if ((err = genl_ctrl_alloc_cache(sk, &cache)) < 0)
            return err;

      family = genl_ctrl_search_by_name(cache, name);
      if (family == NULL) {
            err = -NLE_OBJ_NOTFOUND;
            goto errout;
      }

      err = genl_family_get_id(family);
      genl_family_put(family);
errout:
      nl_cache_free(cache);

      return err;
}


Generated by  Doxygen 1.6.0   Back to index