Grégoire Baron | eb4d406 | 2010-08-18 13:10:35 +0000 | [diff] [blame] | 1 | #ifndef __NET_TC_CSUM_H |
| 2 | #define __NET_TC_CSUM_H |
| 3 | |
| 4 | #include <linux/types.h> |
| 5 | #include <net/act_api.h> |
Or Gerlitz | 3aa4266 | 2017-05-10 13:48:41 +0300 | [diff] [blame] | 6 | #include <linux/tc_act/tc_csum.h> |
Grégoire Baron | eb4d406 | 2010-08-18 13:10:35 +0000 | [diff] [blame] | 7 | |
| 8 | struct tcf_csum { |
WANG Cong | ec0595c | 2016-07-25 16:09:42 -0700 | [diff] [blame] | 9 | struct tc_action common; |
Grégoire Baron | eb4d406 | 2010-08-18 13:10:35 +0000 | [diff] [blame] | 10 | |
| 11 | u32 update_flags; |
| 12 | }; |
WANG Cong | a85a970 | 2016-07-25 16:09:41 -0700 | [diff] [blame] | 13 | #define to_tcf_csum(a) ((struct tcf_csum *)a) |
Grégoire Baron | eb4d406 | 2010-08-18 13:10:35 +0000 | [diff] [blame] | 14 | |
Or Gerlitz | 3aa4266 | 2017-05-10 13:48:41 +0300 | [diff] [blame] | 15 | static inline bool is_tcf_csum(const struct tc_action *a) |
| 16 | { |
| 17 | #ifdef CONFIG_NET_CLS_ACT |
| 18 | if (a->ops && a->ops->type == TCA_ACT_CSUM) |
| 19 | return true; |
| 20 | #endif |
| 21 | return false; |
| 22 | } |
| 23 | |
| 24 | static inline u32 tcf_csum_update_flags(const struct tc_action *a) |
| 25 | { |
| 26 | return to_tcf_csum(a)->update_flags; |
| 27 | } |
| 28 | |
Grégoire Baron | eb4d406 | 2010-08-18 13:10:35 +0000 | [diff] [blame] | 29 | #endif /* __NET_TC_CSUM_H */ |