Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef __NET_TC_GACT_H |
| 2 | #define __NET_TC_GACT_H |
| 3 | |
| 4 | #include <net/act_api.h> |
John Fastabend | 3b01cf5 | 2016-02-16 21:18:03 -0800 | [diff] [blame] | 5 | #include <linux/tc_act/tc_gact.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | |
David S. Miller | e9ce1cd | 2006-08-21 23:54:55 -0700 | [diff] [blame] | 7 | struct tcf_gact { |
| 8 | struct tcf_common common; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | #ifdef CONFIG_GACT_PROB |
Eric Dumazet | cc6510a | 2015-07-06 05:18:06 -0700 | [diff] [blame] | 10 | u16 tcfg_ptype; |
| 11 | u16 tcfg_pval; |
| 12 | int tcfg_paction; |
| 13 | atomic_t packets; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | }; |
WANG Cong | 8606203 | 2014-02-11 17:07:31 -0800 | [diff] [blame] | 16 | #define to_gact(a) \ |
| 17 | container_of(a->priv, struct tcf_gact, common) |
David S. Miller | e9ce1cd | 2006-08-21 23:54:55 -0700 | [diff] [blame] | 18 | |
John Fastabend | 3b01cf5 | 2016-02-16 21:18:03 -0800 | [diff] [blame] | 19 | static inline bool is_tcf_gact_shot(const struct tc_action *a) |
| 20 | { |
Amir Vadai | 00175ae | 2016-03-08 12:42:31 +0200 | [diff] [blame^] | 21 | #ifdef CONFIG_NET_CLS_ACT |
John Fastabend | 3b01cf5 | 2016-02-16 21:18:03 -0800 | [diff] [blame] | 22 | 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 Vadai | 00175ae | 2016-03-08 12:42:31 +0200 | [diff] [blame^] | 31 | #endif |
John Fastabend | 3b01cf5 | 2016-02-16 21:18:03 -0800 | [diff] [blame] | 32 | return false; |
| 33 | } |
David S. Miller | e9ce1cd | 2006-08-21 23:54:55 -0700 | [diff] [blame] | 34 | #endif /* __NET_TC_GACT_H */ |