1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __NETNS_CONNTRACK_H
3 #define __NETNS_CONNTRACK_H
5 #include <linux/list.h>
6 #include <linux/list_nulls.h>
7 #include <linux/atomic.h>
8 #include <linux/workqueue.h>
9 #include <linux/netfilter/nf_conntrack_tcp.h>
10 #ifdef CONFIG_NF_CT_PROTO_DCCP
11 #include <linux/netfilter/nf_conntrack_dccp.h>
13 #ifdef CONFIG_NF_CT_PROTO_SCTP
14 #include <linux/netfilter/nf_conntrack_sctp.h>
16 #include <linux/seqlock.h>
18 struct ctl_table_header
;
19 struct nf_conntrack_ecache
;
23 struct ctl_table_header
*ctl_table_header
;
24 struct ctl_table
*ctl_table
;
29 struct nf_generic_net
{
30 struct nf_proto_net pn
;
35 struct nf_proto_net pn
;
36 unsigned int timeouts
[TCP_CONNTRACK_TIMEOUT_MAX
];
37 unsigned int tcp_loose
;
38 unsigned int tcp_be_liberal
;
39 unsigned int tcp_max_retrans
;
49 struct nf_proto_net pn
;
50 unsigned int timeouts
[UDP_CT_MAX
];
54 struct nf_proto_net pn
;
58 #ifdef CONFIG_NF_CT_PROTO_DCCP
60 struct nf_proto_net pn
;
62 unsigned int dccp_timeout
[CT_DCCP_MAX
+ 1];
66 #ifdef CONFIG_NF_CT_PROTO_SCTP
68 struct nf_proto_net pn
;
69 unsigned int timeouts
[SCTP_CONNTRACK_MAX
];
74 struct nf_generic_net generic
;
75 struct nf_tcp_net tcp
;
76 struct nf_udp_net udp
;
77 struct nf_icmp_net icmp
;
78 struct nf_icmp_net icmpv6
;
79 #ifdef CONFIG_NF_CT_PROTO_DCCP
80 struct nf_dccp_net dccp
;
82 #ifdef CONFIG_NF_CT_PROTO_SCTP
83 struct nf_sctp_net sctp
;
89 struct hlist_nulls_head unconfirmed
;
90 struct hlist_nulls_head dying
;
95 unsigned int expect_count
;
96 #ifdef CONFIG_NF_CONNTRACK_EVENTS
97 struct delayed_work ecache_dwork
;
98 bool ecache_dwork_pending
;
101 struct ctl_table_header
*sysctl_header
;
102 struct ctl_table_header
*acct_sysctl_header
;
103 struct ctl_table_header
*tstamp_sysctl_header
;
104 struct ctl_table_header
*event_sysctl_header
;
105 struct ctl_table_header
*helper_sysctl_header
;
107 unsigned int sysctl_log_invalid
; /* Log invalid packets */
110 int sysctl_auto_assign_helper
;
111 bool auto_assign_helper_warned
;
115 struct ct_pcpu __percpu
*pcpu_lists
;
116 struct ip_conntrack_stat __percpu
*stat
;
117 struct nf_ct_event_notifier __rcu
*nf_conntrack_event_cb
;
118 struct nf_exp_event_notifier __rcu
*nf_expect_event_cb
;
119 struct nf_ip_net nf_ct_proto
;
120 #if defined(CONFIG_NF_CONNTRACK_LABELS)
121 unsigned int labels_used
;