1 #ifndef __NET_TC_GACT_H
2 #define __NET_TC_GACT_H
4 #include <net/act_api.h>
5 #include <linux/tc_act/tc_gact.h>
8 struct tc_action common;
9 #ifdef CONFIG_GACT_PROB
16 #define to_gact(a) ((struct tcf_gact *)a)
18 static inline bool __is_tcf_gact_act(const struct tc_action *a, int act,
21 #ifdef CONFIG_NET_CLS_ACT
22 struct tcf_gact *gact;
24 if (a->ops && a->ops->type != TCA_ACT_GACT)
28 if ((!is_ext && gact->tcf_action == act) ||
29 (is_ext && TC_ACT_EXT_CMP(gact->tcf_action, act)))
36 static inline bool is_tcf_gact_shot(const struct tc_action *a)
38 return __is_tcf_gact_act(a, TC_ACT_SHOT, false);
41 static inline bool is_tcf_gact_trap(const struct tc_action *a)
43 return __is_tcf_gact_act(a, TC_ACT_TRAP, false);
46 static inline bool is_tcf_gact_goto_chain(const struct tc_action *a)
48 return __is_tcf_gact_act(a, TC_ACT_GOTO_CHAIN, true);
51 static inline u32 tcf_gact_goto_chain_index(const struct tc_action *a)
53 return a->goto_chain->index;
56 #endif /* __NET_TC_GACT_H */