Пример #1
0
static void u32_dump_details(struct rtnl_tc *tc, void *data,
			     struct nl_dump_params *p)
{
	struct rtnl_u32 *u = data;
	struct tc_u32_sel *s;

	if (!u)
		return;

	if (!(u->cu_mask & U32_ATTR_SELECTOR)) {
		nl_dump(p, "no-selector\n");
		return;
	}
	
	s = u->cu_selector->d_data;

	nl_dump(p, "nkeys %u ", s->nkeys);

	if (u->cu_mask & U32_ATTR_HASH)
		nl_dump(p, "ht key 0x%x hash 0x%u",
			TC_U32_USERHTID(u->cu_hash), TC_U32_HASH(u->cu_hash));

	if (u->cu_mask & U32_ATTR_LINK)
		nl_dump(p, "link %u ", u->cu_link);

	if (u->cu_mask & U32_ATTR_INDEV)
		nl_dump(p, "indev %s ", u->cu_indev);

	print_selector(p, s, u);
	nl_dump(p, "\n");
}
Пример #2
0
static void u32_dump_details(struct rtnl_cls *cls, struct nl_dump_params *p)
{
	struct rtnl_u32 *u = rtnl_cls_data(cls);
	struct tc_u32_sel *s;

	if (!(u->cu_mask & U32_ATTR_SELECTOR)) {
		nl_dump(p, "no-selector\n");
		return;
	}
	
	s = u->cu_selector->d_data;

	nl_dump(p, "nkeys %u ", s->nkeys);

	if (u->cu_mask & U32_ATTR_HASH)
		nl_dump(p, "ht key 0x%x hash 0x%u",
			TC_U32_USERHTID(u->cu_hash), TC_U32_HASH(u->cu_hash));

	if (u->cu_mask & U32_ATTR_LINK)
		nl_dump(p, "link %u ", u->cu_link);

	if (u->cu_mask & U32_ATTR_INDEV)
		nl_dump(p, "indev %s ", u->cu_indev);

	print_selector(p, s, cls, u);
	nl_dump(p, "\n");

#if 0	
#define U32_ATTR_ACTION       0x040
#define U32_ATTR_POLICE       0x080

	struct nl_data   act;
	struct nl_data   police;
#endif
}
Пример #3
0
static void u32_dump_details(struct rtnl_tc *tc, void *data,
			     struct nl_dump_params *p)
{
	struct rtnl_u32 *u = data;
	struct tc_u32_sel *s = NULL;
	struct tc_u32_mark *m;

	if (!u)
		return;

	if (!(u->cu_mask & (U32_ATTR_SELECTOR & U32_ATTR_MARK))) {
		nl_dump(p, "no-selector no-mark\n");
		return;
	}

	if (!(u->cu_mask & U32_ATTR_SELECTOR)) {
		nl_dump(p, "no-selector");
	} else {
		s = u->cu_selector->d_data;
		nl_dump(p, "nkeys %u", s->nkeys);
	}

	if (!(u->cu_mask & U32_ATTR_MARK)) {
		nl_dump(p, " no-mark");
	} else {
		m = u->cu_mark->d_data;
		nl_dump(p, " mark 0x%u 0x%u", m->val, m->mask);
	}

	if (u->cu_mask & U32_ATTR_HASH)
		nl_dump(p, " ht key 0x%x hash 0x%u",
			TC_U32_USERHTID(u->cu_hash), TC_U32_HASH(u->cu_hash));

	if (u->cu_mask & U32_ATTR_LINK)
		nl_dump(p, " link %u", u->cu_link);

	if (u->cu_mask & U32_ATTR_INDEV)
		nl_dump(p, " indev %s", u->cu_indev);

	if (u->cu_mask & U32_ATTR_SELECTOR)
		print_selector(p, s, u);

	nl_dump(p, "\n");
}