blob: 93c520b83d10994236c09be729dcd55dcff6dc2b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef __NET_TC_GACT_H
2#define __NET_TC_GACT_H
3
4#include <net/act_api.h>
John Fastabend3b01cf52016-02-16 21:18:03 -08005#include <linux/tc_act/tc_gact.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006
David S. Millere9ce1cd2006-08-21 23:54:55 -07007struct tcf_gact {
8 struct tcf_common common;
Linus Torvalds1da177e2005-04-16 15:20:36 -07009#ifdef CONFIG_GACT_PROB
Eric Dumazetcc6510a2015-07-06 05:18:06 -070010 u16 tcfg_ptype;
11 u16 tcfg_pval;
12 int tcfg_paction;
13 atomic_t packets;
Linus Torvalds1da177e2005-04-16 15:20:36 -070014#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070015};
WANG Cong86062032014-02-11 17:07:31 -080016#define to_gact(a) \
17 container_of(a->priv, struct tcf_gact, common)
David S. Millere9ce1cd2006-08-21 23:54:55 -070018
John Fastabend3b01cf52016-02-16 21:18:03 -080019static inline bool is_tcf_gact_shot(const struct tc_action *a)
20{
Amir Vadai00175ae2016-03-08 12:42:31 +020021#ifdef CONFIG_NET_CLS_ACT
John Fastabend3b01cf52016-02-16 21:18:03 -080022 struct tcf_gact *gact;
23
24 if (a->ops && a->ops->type != TCA_ACT_GACT)
25 return false;
26
27 gact = a->priv;
28 if (gact->tcf_action == TC_ACT_SHOT)
29 return true;
30
Amir Vadai00175ae2016-03-08 12:42:31 +020031#endif
John Fastabend3b01cf52016-02-16 21:18:03 -080032 return false;
33}
David S. Millere9ce1cd2006-08-21 23:54:55 -070034#endif /* __NET_TC_GACT_H */