]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
9fb9cbb1 YK |
2 | #ifndef _NF_CONNTRACK_COMMON_H |
3 | #define _NF_CONNTRACK_COMMON_H | |
9fb9cbb1 | 4 | |
261db6c2 | 5 | #include <linux/atomic.h> |
94d0ec58 | 6 | #include <uapi/linux/netfilter/nf_conntrack_common.h> |
9fb9cbb1 | 7 | |
d94d9fee | 8 | struct ip_conntrack_stat { |
9fb9cbb1 | 9 | unsigned int found; |
9fb9cbb1 | 10 | unsigned int invalid; |
9fb9cbb1 YK |
11 | unsigned int insert; |
12 | unsigned int insert_failed; | |
bc924704 | 13 | unsigned int clash_resolve; |
9fb9cbb1 YK |
14 | unsigned int drop; |
15 | unsigned int early_drop; | |
16 | unsigned int error; | |
17 | unsigned int expect_new; | |
18 | unsigned int expect_create; | |
19 | unsigned int expect_delete; | |
af740b2c | 20 | unsigned int search_restart; |
d7e7747a | 21 | unsigned int chaintoolong; |
9fb9cbb1 YK |
22 | }; |
23 | ||
261db6c2 JS |
24 | #define NFCT_INFOMASK 7UL |
25 | #define NFCT_PTRMASK ~(NFCT_INFOMASK) | |
26 | ||
27 | struct nf_conntrack { | |
28 | atomic_t use; | |
29 | }; | |
30 | ||
31 | void nf_conntrack_destroy(struct nf_conntrack *nfct); | |
32 | static inline void nf_conntrack_put(struct nf_conntrack *nfct) | |
33 | { | |
34 | if (nfct && atomic_dec_and_test(&nfct->use)) | |
35 | nf_conntrack_destroy(nfct); | |
36 | } | |
37 | static inline void nf_conntrack_get(struct nf_conntrack *nfct) | |
38 | { | |
39 | if (nfct) | |
40 | atomic_inc(&nfct->use); | |
41 | } | |
42 | ||
9fb9cbb1 | 43 | #endif /* _NF_CONNTRACK_COMMON_H */ |