tc_gact.h 638 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 tcf_common 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) \
  15. container_of(a->priv, struct tcf_gact, common)
  16. static inline bool is_tcf_gact_shot(const struct tc_action *a)
  17. {
  18. #ifdef CONFIG_NET_CLS_ACT
  19. struct tcf_gact *gact;
  20. if (a->ops && a->ops->type != TCA_ACT_GACT)
  21. return false;
  22. gact = a->priv;
  23. if (gact->tcf_action == TC_ACT_SHOT)
  24. return true;
  25. #endif
  26. return false;
  27. }
  28. #endif /* __NET_TC_GACT_H */