1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _NF_CONNTRACK_COMMON_H
3 #define _NF_CONNTRACK_COMMON_H
5 #include <linux/refcount.h>
6 #include <uapi/linux/netfilter/nf_conntrack_common.h>
8 struct ip_conntrack_stat {
12 unsigned int insert_failed;
13 unsigned int clash_resolve;
15 unsigned int early_drop;
17 unsigned int expect_new;
18 unsigned int expect_create;
19 unsigned int expect_delete;
20 unsigned int search_restart;
21 unsigned int chaintoolong;
24 #define NFCT_INFOMASK 7UL
25 #define NFCT_PTRMASK ~(NFCT_INFOMASK)
31 void nf_conntrack_destroy(struct nf_conntrack *nfct);
32 static inline void nf_conntrack_put(struct nf_conntrack *nfct)
34 if (nfct && refcount_dec_and_test(&nfct->use))
35 nf_conntrack_destroy(nfct);
37 static inline void nf_conntrack_get(struct nf_conntrack *nfct)
40 refcount_inc(&nfct->use);
43 #endif /* _NF_CONNTRACK_COMMON_H */