blob: a9060dd99db7691fb9521eb0fc22f70b75e26fb5 [file] [log] [blame]
Patrick McHardy96518512013-10-14 11:00:02 +02001#ifndef _NET_NF_TABLES_CORE_H
2#define _NET_NF_TABLES_CORE_H
3
Joe Perches5eccdfa2013-10-19 22:05:31 -07004int nf_tables_core_module_init(void);
5void nf_tables_core_module_exit(void);
Patrick McHardy96518512013-10-14 11:00:02 +02006
Joe Perches5eccdfa2013-10-19 22:05:31 -07007int nft_immediate_module_init(void);
8void nft_immediate_module_exit(void);
Patrick McHardy96518512013-10-14 11:00:02 +02009
Patrick McHardycb7dbfd2013-10-10 23:35:40 +020010struct nft_cmp_fast_expr {
11 u32 data;
12 enum nft_registers sreg:8;
13 u8 len;
14};
15
Patrick McHardyb855d412014-04-12 13:17:57 +020016/* Calculate the mask for the nft_cmp_fast expression. On big endian the
17 * mask needs to include the *upper* bytes when interpreting that data as
18 * something smaller than the full u32, therefore a cpu_to_le32 is done.
19 */
20static inline u32 nft_cmp_fast_mask(unsigned int len)
21{
22 return cpu_to_le32(~0U >> (FIELD_SIZEOF(struct nft_cmp_fast_expr,
23 data) * BITS_PER_BYTE - len));
24}
25
Patrick McHardycb7dbfd2013-10-10 23:35:40 +020026extern const struct nft_expr_ops nft_cmp_fast_ops;
27
Joe Perches5eccdfa2013-10-19 22:05:31 -070028int nft_cmp_module_init(void);
29void nft_cmp_module_exit(void);
Patrick McHardy96518512013-10-14 11:00:02 +020030
Joe Perches5eccdfa2013-10-19 22:05:31 -070031int nft_lookup_module_init(void);
32void nft_lookup_module_exit(void);
Patrick McHardy96518512013-10-14 11:00:02 +020033
Patrick McHardy22fe54d2015-04-05 14:41:08 +020034int nft_dynset_module_init(void);
35void nft_dynset_module_exit(void);
36
Joe Perches5eccdfa2013-10-19 22:05:31 -070037int nft_bitwise_module_init(void);
38void nft_bitwise_module_exit(void);
Patrick McHardy96518512013-10-14 11:00:02 +020039
Joe Perches5eccdfa2013-10-19 22:05:31 -070040int nft_byteorder_module_init(void);
41void nft_byteorder_module_exit(void);
Patrick McHardy96518512013-10-14 11:00:02 +020042
Patrick McHardyc29b72e2013-10-10 11:06:41 +020043struct nft_payload {
44 enum nft_payload_bases base:8;
45 u8 offset;
46 u8 len;
47 enum nft_registers dreg:8;
48};
49
Patrick McHardy7ec3f7b2015-11-24 10:00:22 +000050struct nft_payload_set {
51 enum nft_payload_bases base:8;
52 u8 offset;
53 u8 len;
54 enum nft_registers sreg:8;
55 u8 csum_type;
56 u8 csum_offset;
57};
58
Patrick McHardyc29b72e2013-10-10 11:06:41 +020059extern const struct nft_expr_ops nft_payload_fast_ops;
Florian Westphale639f7a2015-11-28 21:53:05 +010060extern struct static_key_false nft_trace_enabled;
Patrick McHardyc29b72e2013-10-10 11:06:41 +020061
Joe Perches5eccdfa2013-10-19 22:05:31 -070062int nft_payload_module_init(void);
63void nft_payload_module_exit(void);
Patrick McHardy96518512013-10-14 11:00:02 +020064
65#endif /* _NET_NF_TABLES_CORE_H */