/* Build a class cache including all classes attached to the specified interface  */
int rtnl_class_alloc_cache(struct nl_sock *sk, int ifindex, struct nl_cache **result)
/* Build a class cache including all classes attached to the specified interface  */
int rtnl_class_alloc_cache(struct nl_sock *sk, int ifindex, struct nl_cache **result)
{
	struct nl_cache * cache;
	int err;
	cache = nl_cache_alloc(&rtnl_class_ops);
	if (!cache)
		return -NLE_NOMEM;
	cache->c_iarg1 = ifindex;
	if (sk && (err = nl_cache_refill(sk, cache)) < 0) {
		nl_cache_free(cache);
		return err;
	}
	*result = cache;
	return 0;
}