Exemplo n.º 1
0
static void print_tc_childs(struct rtnl_tc *tc, void *arg)
{
	struct rtnl_class *filter;

	filter = nl_cli_class_alloc();

	rtnl_tc_set_parent(TC_CAST(filter), rtnl_tc_get_handle(tc));
	rtnl_tc_set_ifindex(TC_CAST(filter), rtnl_tc_get_ifindex(tc));

	nl_cache_foreach_filter(class_cache, OBJ_CAST(filter), &print_class, arg);

	rtnl_class_put(filter);
}
Exemplo n.º 2
0
static void list_classes(int ifindex, uint32_t parent)
{
	struct nl_cache *class_cache;
	struct rtnl_class *filter = nl_cli_class_alloc();

	class_cache = nl_cli_class_alloc_cache(sock, ifindex);

	rtnl_tc_set_parent((struct rtnl_tc *) filter, parent);
	params.dp_prefix += NUM_INDENT;
	nl_cache_foreach_filter(class_cache, OBJ_CAST(filter), list_class, NULL);
	params.dp_prefix -= NUM_INDENT;

	rtnl_class_put(filter);
	nl_cache_free(class_cache);
}