blob: b6f173910226795045ccb5b62d7029c95a6f6c99 [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 {
WANG Congec0595c2016-07-25 16:09:42 -07008 struct tc_action 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 Conga85a9702016-07-25 16:09:41 -070016#define to_gact(a) ((struct tcf_gact *)a)
David S. Millere9ce1cd2006-08-21 23:54:55 -070017
John Fastabend3b01cf52016-02-16 21:18:03 -080018static inline bool is_tcf_gact_shot(const struct tc_action *a)
19{
Amir Vadai00175ae2016-03-08 12:42:31 +020020#ifdef CONFIG_NET_CLS_ACT
John Fastabend3b01cf52016-02-16 21:18:03 -080021 struct tcf_gact *gact;
22
23 if (a->ops && a->ops->type != TCA_ACT_GACT)
24 return false;
25
WANG Conga85a9702016-07-25 16:09:41 -070026 gact = to_gact(a);
John Fastabend3b01cf52016-02-16 21:18:03 -080027 if (gact->tcf_action == TC_ACT_SHOT)
28 return true;
29
Amir Vadai00175ae2016-03-08 12:42:31 +020030#endif
John Fastabend3b01cf52016-02-16 21:18:03 -080031 return false;
32}
David S. Millere9ce1cd2006-08-21 23:54:55 -070033#endif /* __NET_TC_GACT_H */