tc_gact.h 613 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef __NET_TC_GACT_H
  2. #define __NET_TC_GACT_H
  3. #include <net/act_api.h>
  4. #include <linux/tc_act/tc_gact.h>
  5. struct tcf_gact {
  6. struct tc_action common;
  7. #ifdef CONFIG_GACT_PROB
  8. u16 tcfg_ptype;
  9. u16 tcfg_pval;
  10. int tcfg_paction;
  11. atomic_t packets;
  12. #endif
  13. };
  14. #define to_gact(a) ((struct tcf_gact *)a)
  15. static inline bool is_tcf_gact_shot(const struct tc_action *a)
  16. {
  17. #ifdef CONFIG_NET_CLS_ACT
  18. struct tcf_gact *gact;
  19. if (a->ops && a->ops->type != TCA_ACT_GACT)
  20. return false;
  21. gact = to_gact(a);
  22. if (gact->tcf_action == TC_ACT_SHOT)
  23. return true;
  24. #endif
  25. return false;
  26. }
  27. #endif /* __NET_TC_GACT_H */