/* Resolve generic netlink family name to its identifier  */
int genl_ctrl_resolve(struct nl_sock *sk, const char *name)
/* Resolve generic netlink family name to its identifier  */
int genl_ctrl_resolve(struct nl_sock *sk, const char *name)
{
	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;
}