]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
dfdb8d79 AD |
2 | #ifndef __NETNS_CONNTRACK_H |
3 | #define __NETNS_CONNTRACK_H | |
4 | ||
63c9a262 | 5 | #include <linux/list.h> |
ea781f19 | 6 | #include <linux/list_nulls.h> |
60063497 | 7 | #include <linux/atomic.h> |
9500507c | 8 | #include <linux/workqueue.h> |
d2ba1fde | 9 | #include <linux/netfilter/nf_conntrack_tcp.h> |
c51d3901 DC |
10 | #ifdef CONFIG_NF_CT_PROTO_DCCP |
11 | #include <linux/netfilter/nf_conntrack_dccp.h> | |
12 | #endif | |
a85406af DC |
13 | #ifdef CONFIG_NF_CT_PROTO_SCTP |
14 | #include <linux/netfilter/nf_conntrack_sctp.h> | |
15 | #endif | |
93bb0ceb | 16 | #include <linux/seqlock.h> |
49ac8713 | 17 | |
80250707 | 18 | struct ctl_table_header; |
6058fa6b AD |
19 | struct nf_conntrack_ecache; |
20 | ||
2c352f44 G |
21 | struct nf_proto_net { |
22 | #ifdef CONFIG_SYSCTL | |
23 | struct ctl_table_header *ctl_table_header; | |
24 | struct ctl_table *ctl_table; | |
2c352f44 G |
25 | #endif |
26 | unsigned int users; | |
27 | }; | |
28 | ||
15f585bd G |
29 | struct nf_generic_net { |
30 | struct nf_proto_net pn; | |
31 | unsigned int timeout; | |
32 | }; | |
33 | ||
d2ba1fde G |
34 | struct nf_tcp_net { |
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; | |
40 | }; | |
41 | ||
0ce490ad G |
42 | enum udp_conntrack { |
43 | UDP_CT_UNREPLIED, | |
44 | UDP_CT_REPLIED, | |
45 | UDP_CT_MAX | |
46 | }; | |
47 | ||
48 | struct nf_udp_net { | |
49 | struct nf_proto_net pn; | |
50 | unsigned int timeouts[UDP_CT_MAX]; | |
51 | }; | |
52 | ||
4b626b9c G |
53 | struct nf_icmp_net { |
54 | struct nf_proto_net pn; | |
55 | unsigned int timeout; | |
56 | }; | |
57 | ||
c51d3901 DC |
58 | #ifdef CONFIG_NF_CT_PROTO_DCCP |
59 | struct nf_dccp_net { | |
60 | struct nf_proto_net pn; | |
61 | int dccp_loose; | |
62 | unsigned int dccp_timeout[CT_DCCP_MAX + 1]; | |
63 | }; | |
64 | #endif | |
65 | ||
a85406af DC |
66 | #ifdef CONFIG_NF_CT_PROTO_SCTP |
67 | struct nf_sctp_net { | |
68 | struct nf_proto_net pn; | |
69 | unsigned int timeouts[SCTP_CONNTRACK_MAX]; | |
70 | }; | |
71 | #endif | |
72 | ||
524a53e5 | 73 | struct nf_ip_net { |
15f585bd | 74 | struct nf_generic_net generic; |
d2ba1fde | 75 | struct nf_tcp_net tcp; |
0ce490ad | 76 | struct nf_udp_net udp; |
4b626b9c | 77 | struct nf_icmp_net icmp; |
7080ba09 | 78 | struct nf_icmp_net icmpv6; |
c51d3901 DC |
79 | #ifdef CONFIG_NF_CT_PROTO_DCCP |
80 | struct nf_dccp_net dccp; | |
81 | #endif | |
a85406af DC |
82 | #ifdef CONFIG_NF_CT_PROTO_SCTP |
83 | struct nf_sctp_net sctp; | |
84 | #endif | |
524a53e5 G |
85 | }; |
86 | ||
b7779d06 JDB |
87 | struct ct_pcpu { |
88 | spinlock_t lock; | |
89 | struct hlist_nulls_head unconfirmed; | |
90 | struct hlist_nulls_head dying; | |
b7779d06 JDB |
91 | }; |
92 | ||
dfdb8d79 | 93 | struct netns_ct { |
49ac8713 | 94 | atomic_t count; |
9b03f38d | 95 | unsigned int expect_count; |
9500507c FW |
96 | #ifdef CONFIG_NF_CONNTRACK_EVENTS |
97 | struct delayed_work ecache_dwork; | |
98 | bool ecache_dwork_pending; | |
99 | #endif | |
8cf4d6a2 JDB |
100 | #ifdef CONFIG_SYSCTL |
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; | |
106 | #endif | |
8cf4d6a2 | 107 | unsigned int sysctl_log_invalid; /* Log invalid packets */ |
8cf4d6a2 JDB |
108 | int sysctl_events; |
109 | int sysctl_acct; | |
110 | int sysctl_auto_assign_helper; | |
111 | bool auto_assign_helper_warned; | |
112 | int sysctl_tstamp; | |
113 | int sysctl_checksum; | |
114 | ||
b7779d06 | 115 | struct ct_pcpu __percpu *pcpu_lists; |
7d720c3e | 116 | struct ip_conntrack_stat __percpu *stat; |
70e9942f PNA |
117 | struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb; |
118 | struct nf_exp_event_notifier __rcu *nf_expect_event_cb; | |
524a53e5 | 119 | struct nf_ip_net nf_ct_proto; |
c539f017 FW |
120 | #if defined(CONFIG_NF_CONNTRACK_LABELS) |
121 | unsigned int labels_used; | |
c539f017 | 122 | #endif |
dfdb8d79 AD |
123 | }; |
124 | #endif |