blob: 3248beaf16b0513283cd3c863695a77d09793cdc [file] [log] [blame]
Grégoire Baroneb4d4062010-08-18 13:10:35 +00001#ifndef __NET_TC_CSUM_H
2#define __NET_TC_CSUM_H
3
4#include <linux/types.h>
5#include <net/act_api.h>
Or Gerlitz3aa42662017-05-10 13:48:41 +03006#include <linux/tc_act/tc_csum.h>
Grégoire Baroneb4d4062010-08-18 13:10:35 +00007
8struct tcf_csum {
WANG Congec0595c2016-07-25 16:09:42 -07009 struct tc_action common;
Grégoire Baroneb4d4062010-08-18 13:10:35 +000010
11 u32 update_flags;
12};
WANG Conga85a9702016-07-25 16:09:41 -070013#define to_tcf_csum(a) ((struct tcf_csum *)a)
Grégoire Baroneb4d4062010-08-18 13:10:35 +000014
Or Gerlitz3aa42662017-05-10 13:48:41 +030015static 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
24static inline u32 tcf_csum_update_flags(const struct tc_action *a)
25{
26 return to_tcf_csum(a)->update_flags;
27}
28
Grégoire Baroneb4d4062010-08-18 13:10:35 +000029#endif /* __NET_TC_CSUM_H */