2005-04-17 06:20:36 +08:00
|
|
|
#ifndef __NET_TC_GACT_H
|
|
|
|
#define __NET_TC_GACT_H
|
|
|
|
|
|
|
|
#include <net/act_api.h>
|
2016-02-17 13:18:03 +08:00
|
|
|
#include <linux/tc_act/tc_gact.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2006-08-22 14:54:55 +08:00
|
|
|
struct tcf_gact {
|
2016-07-26 07:09:42 +08:00
|
|
|
struct tc_action common;
|
2005-04-17 06:20:36 +08:00
|
|
|
#ifdef CONFIG_GACT_PROB
|
2015-07-06 20:18:06 +08:00
|
|
|
u16 tcfg_ptype;
|
|
|
|
u16 tcfg_pval;
|
|
|
|
int tcfg_paction;
|
|
|
|
atomic_t packets;
|
2005-04-17 06:20:36 +08:00
|
|
|
#endif
|
|
|
|
};
|
2016-07-26 07:09:41 +08:00
|
|
|
#define to_gact(a) ((struct tcf_gact *)a)
|
2006-08-22 14:54:55 +08:00
|
|
|
|
2016-02-17 13:18:03 +08:00
|
|
|
static inline bool is_tcf_gact_shot(const struct tc_action *a)
|
|
|
|
{
|
2016-03-08 18:42:31 +08:00
|
|
|
#ifdef CONFIG_NET_CLS_ACT
|
2016-02-17 13:18:03 +08:00
|
|
|
struct tcf_gact *gact;
|
|
|
|
|
|
|
|
if (a->ops && a->ops->type != TCA_ACT_GACT)
|
|
|
|
return false;
|
|
|
|
|
2016-07-26 07:09:41 +08:00
|
|
|
gact = to_gact(a);
|
2016-02-17 13:18:03 +08:00
|
|
|
if (gact->tcf_action == TC_ACT_SHOT)
|
|
|
|
return true;
|
|
|
|
|
2016-03-08 18:42:31 +08:00
|
|
|
#endif
|
2016-02-17 13:18:03 +08:00
|
|
|
return false;
|
|
|
|
}
|
2006-08-22 14:54:55 +08:00
|
|
|
#endif /* __NET_TC_GACT_H */
|