tc_gact.h 613 字节
Newer Older
L
Linus Torvalds 已提交
1 2 3 4
#ifndef __NET_TC_GACT_H
#define __NET_TC_GACT_H

#include <net/act_api.h>
5
#include <linux/tc_act/tc_gact.h>
L
Linus Torvalds 已提交
6

7
struct tcf_gact {
8
	struct tc_action	common;
L
Linus Torvalds 已提交
9
#ifdef CONFIG_GACT_PROB
10 11 12 13
	u16			tcfg_ptype;
	u16			tcfg_pval;
	int			tcfg_paction;
	atomic_t		packets;
L
Linus Torvalds 已提交
14 15
#endif
};
16
#define to_gact(a) ((struct tcf_gact *)a)
17

18 19
static inline bool is_tcf_gact_shot(const struct tc_action *a)
{
20
#ifdef CONFIG_NET_CLS_ACT
21 22 23 24 25
	struct tcf_gact *gact;

	if (a->ops && a->ops->type != TCA_ACT_GACT)
		return false;

26
	gact = to_gact(a);
27 28 29
	if (gact->tcf_action == TC_ACT_SHOT)
		return true;

30
#endif
31 32
	return false;
}
33
#endif /* __NET_TC_GACT_H */