1 /* SPDX-License-Identifier: GPL-2.0 */
3 * ipv4 in net namespaces
6 #ifndef __NETNS_IPV4_H__
7 #define __NETNS_IPV4_H__
9 #include <linux/uidgid.h>
10 #include <net/inet_frag.h>
11 #include <linux/rcupdate.h>
12 #include <linux/siphash.h>
14 struct tcpm_hash_bucket;
15 struct ctl_table_header;
27 struct ping_group_range {
34 struct inet_timewait_death_row {
37 struct inet_hashinfo *hashinfo ____cacheline_aligned_in_smp;
38 int sysctl_max_tw_buckets;
41 struct tcp_fastopen_context;
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;
51 struct ipv4_devconf *devconf_all;
52 struct ipv4_devconf *devconf_dflt;
53 struct ip_ra_chain __rcu *ra_chain;
54 struct mutex ra_mutex;
55 #ifdef CONFIG_IP_MULTIPLE_TABLES
56 struct fib_rules_ops *rules_ops;
57 bool fib_has_custom_rules;
58 unsigned int fib_rules_require_fldissect;
59 struct fib_table __rcu *fib_main;
60 struct fib_table __rcu *fib_default;
62 bool fib_has_custom_local_routes;
63 #ifdef CONFIG_IP_ROUTE_CLASSID
64 atomic_t fib_num_tclassid_users;
66 struct hlist_head *fib_table_hash;
67 bool fib_offload_disabled;
70 struct sock * __percpu *icmp_sk;
71 struct sock *mc_autojoin_sk;
73 struct inet_peer_base *peers;
75 #ifdef CONFIG_NETFILTER
76 struct xt_table *iptable_filter;
77 struct xt_table *iptable_mangle;
78 struct xt_table *iptable_raw;
79 struct xt_table *arptable_filter;
80 #ifdef CONFIG_SECURITY
81 struct xt_table *iptable_security;
83 struct xt_table *nat_table;
86 u8 sysctl_icmp_echo_ignore_all;
87 u8 sysctl_icmp_echo_ignore_broadcasts;
88 u8 sysctl_icmp_ignore_bogus_error_responses;
89 u8 sysctl_icmp_errors_use_inbound_ifaddr;
90 int sysctl_icmp_ratelimit;
91 int sysctl_icmp_ratemask;
93 struct local_ports ip_local_ports;
96 u8 sysctl_tcp_ecn_fallback;
98 u8 sysctl_ip_default_ttl;
99 u8 sysctl_ip_no_pmtu_disc;
100 u8 sysctl_ip_fwd_use_pmtu;
101 int sysctl_ip_fwd_update_priority;
102 u8 sysctl_ip_nonlocal_bind;
103 u8 sysctl_ip_autobind_reuse;
104 /* Shall we try to damage output packets if routing dev changes? */
105 u8 sysctl_ip_dynaddr;
106 u8 sysctl_ip_early_demux;
107 #ifdef CONFIG_NET_L3_MASTER_DEV
108 u8 sysctl_raw_l3mdev_accept;
110 int sysctl_tcp_early_demux;
111 int sysctl_udp_early_demux;
113 u8 sysctl_nexthop_compat_mode;
115 u8 sysctl_fwmark_reflect;
116 u8 sysctl_tcp_fwmark_accept;
117 #ifdef CONFIG_NET_L3_MASTER_DEV
118 u8 sysctl_tcp_l3mdev_accept;
120 u8 sysctl_tcp_mtu_probing;
121 int sysctl_tcp_mtu_probe_floor;
122 int sysctl_tcp_base_mss;
123 int sysctl_tcp_min_snd_mss;
124 int sysctl_tcp_probe_threshold;
125 u32 sysctl_tcp_probe_interval;
127 int sysctl_tcp_keepalive_time;
128 int sysctl_tcp_keepalive_intvl;
129 u8 sysctl_tcp_keepalive_probes;
131 u8 sysctl_tcp_syn_retries;
132 u8 sysctl_tcp_synack_retries;
133 u8 sysctl_tcp_syncookies;
134 u8 sysctl_tcp_migrate_req;
135 int sysctl_tcp_reordering;
136 u8 sysctl_tcp_retries1;
137 u8 sysctl_tcp_retries2;
138 u8 sysctl_tcp_orphan_retries;
139 u8 sysctl_tcp_tw_reuse;
140 int sysctl_tcp_fin_timeout;
141 unsigned int sysctl_tcp_notsent_lowat;
143 u8 sysctl_tcp_window_scaling;
144 u8 sysctl_tcp_timestamps;
145 u8 sysctl_tcp_early_retrans;
146 u8 sysctl_tcp_recovery;
147 u8 sysctl_tcp_thin_linear_timeouts;
148 u8 sysctl_tcp_slow_start_after_idle;
149 u8 sysctl_tcp_retrans_collapse;
150 u8 sysctl_tcp_stdurg;
151 u8 sysctl_tcp_rfc1337;
152 u8 sysctl_tcp_abort_on_overflow;
153 u8 sysctl_tcp_fack; /* obsolete */
154 int sysctl_tcp_max_reordering;
155 int sysctl_tcp_adv_win_scale;
157 u8 sysctl_tcp_app_win;
159 u8 sysctl_tcp_nometrics_save;
160 u8 sysctl_tcp_no_ssthresh_metrics_save;
161 u8 sysctl_tcp_moderate_rcvbuf;
162 u8 sysctl_tcp_tso_win_divisor;
163 u8 sysctl_tcp_workaround_signed_windows;
164 int sysctl_tcp_limit_output_bytes;
165 int sysctl_tcp_challenge_ack_limit;
166 int sysctl_tcp_min_rtt_wlen;
167 u8 sysctl_tcp_min_tso_segs;
168 u8 sysctl_tcp_autocorking;
169 u8 sysctl_tcp_reflect_tos;
170 int sysctl_tcp_invalid_ratelimit;
171 int sysctl_tcp_pacing_ss_ratio;
172 int sysctl_tcp_pacing_ca_ratio;
173 int sysctl_tcp_wmem[3];
174 int sysctl_tcp_rmem[3];
175 int sysctl_tcp_comp_sack_nr;
176 unsigned long sysctl_tcp_comp_sack_delay_ns;
177 unsigned long sysctl_tcp_comp_sack_slack_ns;
178 struct inet_timewait_death_row tcp_death_row;
179 int sysctl_max_syn_backlog;
180 int sysctl_tcp_fastopen;
181 const struct tcp_congestion_ops __rcu *tcp_congestion_control;
182 struct tcp_fastopen_context __rcu *tcp_fastopen_ctx;
183 spinlock_t tcp_fastopen_ctx_lock;
184 unsigned int sysctl_tcp_fastopen_blackhole_timeout;
185 atomic_t tfo_active_disable_times;
186 unsigned long tfo_active_disable_stamp;
188 int sysctl_udp_wmem_min;
189 int sysctl_udp_rmem_min;
191 #ifdef CONFIG_NET_L3_MASTER_DEV
192 int sysctl_udp_l3mdev_accept;
195 int sysctl_igmp_max_memberships;
196 int sysctl_igmp_max_msf;
197 int sysctl_igmp_llm_reports;
200 struct ping_group_range ping_group_range;
202 atomic_t dev_addr_genid;
205 unsigned long *sysctl_local_reserved_ports;
206 int sysctl_ip_prot_sock;
209 #ifdef CONFIG_IP_MROUTE
210 #ifndef CONFIG_IP_MROUTE_MULTIPLE_TABLES
211 struct mr_table *mrt;
213 struct list_head mr_tables;
214 struct fib_rules_ops *mr_rules_ops;
217 #ifdef CONFIG_IP_ROUTE_MULTIPATH
218 int sysctl_fib_multipath_use_neigh;
219 int sysctl_fib_multipath_hash_policy;
222 struct fib_notifier_ops *notifier_ops;
223 unsigned int fib_seq; /* protected by rtnl_mutex */
225 struct fib_notifier_ops *ipmr_notifier_ops;
226 unsigned int ipmr_seq; /* protected by rtnl_mutex */
229 siphash_key_t ip_id_key;