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
;
21 struct nf_generic_net
{
26 unsigned int timeouts
[TCP_CONNTRACK_TIMEOUT_MAX
];
39 unsigned int timeouts
[UDP_CT_MAX
];
46 #ifdef CONFIG_NF_CT_PROTO_DCCP
49 unsigned int dccp_timeout
[CT_DCCP_MAX
+ 1];
53 #ifdef CONFIG_NF_CT_PROTO_SCTP
55 unsigned int timeouts
[SCTP_CONNTRACK_MAX
];
59 #ifdef CONFIG_NF_CT_PROTO_GRE
67 struct list_head keymap_list
;
68 unsigned int timeouts
[GRE_CT_MAX
];
73 struct nf_generic_net generic
;
74 struct nf_tcp_net tcp
;
75 struct nf_udp_net udp
;
76 struct nf_icmp_net icmp
;
77 struct nf_icmp_net icmpv6
;
78 #ifdef CONFIG_NF_CT_PROTO_DCCP
79 struct nf_dccp_net dccp
;
81 #ifdef CONFIG_NF_CT_PROTO_SCTP
82 struct nf_sctp_net sctp
;
84 #ifdef CONFIG_NF_CT_PROTO_GRE
85 struct nf_gre_net gre
;
91 struct hlist_nulls_head unconfirmed
;
92 struct hlist_nulls_head dying
;
97 unsigned int expect_count
;
98 #ifdef CONFIG_NF_CONNTRACK_EVENTS
99 struct delayed_work ecache_dwork
;
100 bool ecache_dwork_pending
;
102 bool auto_assign_helper_warned
;
104 struct ctl_table_header
*sysctl_header
;
106 unsigned int sysctl_log_invalid
; /* Log invalid packets */
109 int sysctl_auto_assign_helper
;
113 struct ct_pcpu __percpu
*pcpu_lists
;
114 struct ip_conntrack_stat __percpu
*stat
;
115 struct nf_ct_event_notifier __rcu
*nf_conntrack_event_cb
;
116 struct nf_exp_event_notifier __rcu
*nf_expect_event_cb
;
117 struct nf_ip_net nf_ct_proto
;
118 #if defined(CONFIG_NF_CONNTRACK_LABELS)
119 unsigned int labels_used
;