]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - include/net/netns/ipv4.h
2cd8b47cf0ba35196516aca98ae630fdddb36ac0
[mirror_ubuntu-bionic-kernel.git] / include / net / netns / ipv4.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * ipv4 in net namespaces
4 */
5
6 #ifndef __NETNS_IPV4_H__
7 #define __NETNS_IPV4_H__
8
9 #include <linux/uidgid.h>
10 #include <net/inet_frag.h>
11 #include <linux/rcupdate.h>
12 #include <linux/siphash.h>
13
14 struct tcpm_hash_bucket;
15 struct ctl_table_header;
16 struct ipv4_devconf;
17 struct fib_rules_ops;
18 struct hlist_head;
19 struct fib_table;
20 struct sock;
21 struct local_ports {
22 seqlock_t lock;
23 int range[2];
24 bool warned;
25 };
26
27 struct ping_group_range {
28 seqlock_t lock;
29 kgid_t range[2];
30 };
31
32 struct inet_hashinfo;
33
34 struct inet_timewait_death_row {
35 atomic_t tw_count;
36
37 struct inet_hashinfo *hashinfo ____cacheline_aligned_in_smp;
38 int sysctl_max_tw_buckets;
39 };
40
41 struct tcp_fastopen_context;
42
43 struct netns_ipv4 {
44 #ifdef CONFIG_SYSCTL
45 struct ctl_table_header *forw_hdr;
46 struct ctl_table_header *frags_hdr;
47 struct ctl_table_header *ipv4_hdr;
48 struct ctl_table_header *route_hdr;
49 struct ctl_table_header *xfrm4_hdr;
50 #endif
51 struct ipv4_devconf *devconf_all;
52 struct ipv4_devconf *devconf_dflt;
53 #ifdef CONFIG_IP_MULTIPLE_TABLES
54 struct fib_rules_ops *rules_ops;
55 bool fib_has_custom_rules;
56 struct fib_table __rcu *fib_main;
57 struct fib_table __rcu *fib_default;
58 #endif
59 bool fib_has_custom_local_routes;
60 #ifdef CONFIG_IP_ROUTE_CLASSID
61 int fib_num_tclassid_users;
62 #endif
63 struct hlist_head *fib_table_hash;
64 bool fib_offload_disabled;
65 struct sock *fibnl;
66
67 struct sock * __percpu *icmp_sk;
68 struct sock *mc_autojoin_sk;
69
70 struct inet_peer_base *peers;
71 struct sock * __percpu *tcp_sk;
72 struct netns_frags frags;
73 #ifdef CONFIG_NETFILTER
74 struct xt_table *iptable_filter;
75 struct xt_table *iptable_mangle;
76 struct xt_table *iptable_raw;
77 struct xt_table *arptable_filter;
78 #ifdef CONFIG_SECURITY
79 struct xt_table *iptable_security;
80 #endif
81 struct xt_table *nat_table;
82 #endif
83
84 int sysctl_icmp_echo_ignore_all;
85 int sysctl_icmp_echo_ignore_broadcasts;
86 int sysctl_icmp_ignore_bogus_error_responses;
87 int sysctl_icmp_ratelimit;
88 int sysctl_icmp_ratemask;
89 int sysctl_icmp_errors_use_inbound_ifaddr;
90
91 struct local_ports ip_local_ports;
92
93 int sysctl_tcp_ecn;
94 int sysctl_tcp_ecn_fallback;
95
96 int sysctl_ip_default_ttl;
97 int sysctl_ip_no_pmtu_disc;
98 int sysctl_ip_fwd_use_pmtu;
99 int sysctl_ip_nonlocal_bind;
100 /* Shall we try to damage output packets if routing dev changes? */
101 int sysctl_ip_dynaddr;
102 int sysctl_ip_early_demux;
103 int sysctl_tcp_early_demux;
104 int sysctl_udp_early_demux;
105
106 int sysctl_fwmark_reflect;
107 int sysctl_tcp_fwmark_accept;
108 #ifdef CONFIG_NET_L3_MASTER_DEV
109 int sysctl_tcp_l3mdev_accept;
110 #endif
111 int sysctl_tcp_mtu_probing;
112 int sysctl_tcp_base_mss;
113 int sysctl_tcp_min_snd_mss;
114 int sysctl_tcp_probe_threshold;
115 u32 sysctl_tcp_probe_interval;
116
117 int sysctl_tcp_keepalive_time;
118 int sysctl_tcp_keepalive_probes;
119 int sysctl_tcp_keepalive_intvl;
120
121 int sysctl_tcp_syn_retries;
122 int sysctl_tcp_synack_retries;
123 int sysctl_tcp_syncookies;
124 int sysctl_tcp_reordering;
125 int sysctl_tcp_retries1;
126 int sysctl_tcp_retries2;
127 int sysctl_tcp_orphan_retries;
128 int sysctl_tcp_fin_timeout;
129 unsigned int sysctl_tcp_notsent_lowat;
130 int sysctl_tcp_tw_reuse;
131 int sysctl_tcp_sack;
132 int sysctl_tcp_window_scaling;
133 int sysctl_tcp_timestamps;
134 int sysctl_tcp_early_retrans;
135 int sysctl_tcp_recovery;
136 int sysctl_tcp_thin_linear_timeouts;
137 int sysctl_tcp_slow_start_after_idle;
138 int sysctl_tcp_retrans_collapse;
139 int sysctl_tcp_stdurg;
140 int sysctl_tcp_rfc1337;
141 int sysctl_tcp_abort_on_overflow;
142 int sysctl_tcp_fack;
143 int sysctl_tcp_max_reordering;
144 int sysctl_tcp_dsack;
145 int sysctl_tcp_app_win;
146 int sysctl_tcp_adv_win_scale;
147 int sysctl_tcp_frto;
148 int sysctl_tcp_nometrics_save;
149 int sysctl_tcp_moderate_rcvbuf;
150 int sysctl_tcp_tso_win_divisor;
151 int sysctl_tcp_workaround_signed_windows;
152 int sysctl_tcp_limit_output_bytes;
153 int sysctl_tcp_challenge_ack_limit;
154 int sysctl_tcp_min_tso_segs;
155 int sysctl_tcp_min_rtt_wlen;
156 int sysctl_tcp_autocorking;
157 int sysctl_tcp_invalid_ratelimit;
158 int sysctl_tcp_pacing_ss_ratio;
159 int sysctl_tcp_pacing_ca_ratio;
160 int sysctl_tcp_wmem[3];
161 int sysctl_tcp_rmem[3];
162 struct inet_timewait_death_row tcp_death_row;
163 int sysctl_max_syn_backlog;
164 int sysctl_tcp_fastopen;
165 const struct tcp_congestion_ops __rcu *tcp_congestion_control;
166 struct tcp_fastopen_context __rcu *tcp_fastopen_ctx;
167 spinlock_t tcp_fastopen_ctx_lock;
168 unsigned int sysctl_tcp_fastopen_blackhole_timeout;
169 atomic_t tfo_active_disable_times;
170 unsigned long tfo_active_disable_stamp;
171
172 #ifdef CONFIG_NET_L3_MASTER_DEV
173 int sysctl_udp_l3mdev_accept;
174 #endif
175
176 int sysctl_igmp_max_memberships;
177 int sysctl_igmp_max_msf;
178 int sysctl_igmp_llm_reports;
179 int sysctl_igmp_qrv;
180
181 struct ping_group_range ping_group_range;
182
183 atomic_t dev_addr_genid;
184
185 #ifdef CONFIG_SYSCTL
186 unsigned long *sysctl_local_reserved_ports;
187 int sysctl_ip_prot_sock;
188 #endif
189
190 #ifdef CONFIG_IP_MROUTE
191 #ifndef CONFIG_IP_MROUTE_MULTIPLE_TABLES
192 struct mr_table *mrt;
193 #else
194 struct list_head mr_tables;
195 struct fib_rules_ops *mr_rules_ops;
196 #endif
197 #endif
198 #ifdef CONFIG_IP_ROUTE_MULTIPATH
199 int sysctl_fib_multipath_use_neigh;
200 int sysctl_fib_multipath_hash_policy;
201 #endif
202
203 struct fib_notifier_ops *notifier_ops;
204 unsigned int fib_seq; /* protected by rtnl_mutex */
205
206 struct fib_notifier_ops *ipmr_notifier_ops;
207 unsigned int ipmr_seq; /* protected by rtnl_mutex */
208
209 atomic_t rt_genid;
210 siphash_key_t ip_id_key;
211 };
212 #endif