ipv4.h 5.1 KB
Newer Older
1
/* SPDX-License-Identifier: GPL-2.0 */
2 3 4 5 6 7
/*
 * ipv4 in net namespaces
 */

#ifndef __NETNS_IPV4_H__
#define __NETNS_IPV4_H__
8

9
#include <linux/uidgid.h>
10
#include <net/inet_frag.h>
11
#include <linux/rcupdate.h>
12

13
struct tcpm_hash_bucket;
14 15
struct ctl_table_header;
struct ipv4_devconf;
16
struct fib_rules_ops;
17
struct hlist_head;
18
struct fib_table;
19
struct sock;
20 21 22
struct local_ports {
	seqlock_t	lock;
	int		range[2];
23
	bool		warned;
24
};
25

26 27 28 29 30
struct ping_group_range {
	seqlock_t	lock;
	kgid_t		range[2];
};

31 32 33 34 35 36 37 38 39
struct inet_hashinfo;

struct inet_timewait_death_row {
	atomic_t		tw_count;

	struct inet_hashinfo 	*hashinfo ____cacheline_aligned_in_smp;
	int			sysctl_max_tw_buckets;
};

40 41
struct tcp_fastopen_context;

42
struct netns_ipv4 {
43
#ifdef CONFIG_SYSCTL
44
	struct ctl_table_header	*forw_hdr;
45
	struct ctl_table_header	*frags_hdr;
46
	struct ctl_table_header	*ipv4_hdr;
47
	struct ctl_table_header *route_hdr;
48
	struct ctl_table_header *xfrm4_hdr;
49
#endif
50 51
	struct ipv4_devconf	*devconf_all;
	struct ipv4_devconf	*devconf_dflt;
52 53
#ifdef CONFIG_IP_MULTIPLE_TABLES
	struct fib_rules_ops	*rules_ops;
54
	bool			fib_has_custom_rules;
55 56
	struct fib_table __rcu	*fib_main;
	struct fib_table __rcu	*fib_default;
57
#endif
58
	bool			fib_has_custom_local_routes;
59 60
#ifdef CONFIG_IP_ROUTE_CLASSID
	int			fib_num_tclassid_users;
61
#endif
62
	struct hlist_head	*fib_table_hash;
63
	bool			fib_offload_disabled;
64
	struct sock		*fibnl;
65

E
Eric Dumazet 已提交
66
	struct sock  * __percpu	*icmp_sk;
67
	struct sock		*mc_autojoin_sk;
E
Eric Dumazet 已提交
68

69
	struct inet_peer_base	*peers;
70
	struct sock  * __percpu	*tcp_sk;
71
	struct netns_frags	frags;
72 73 74 75
#ifdef CONFIG_NETFILTER
	struct xt_table		*iptable_filter;
	struct xt_table		*iptable_mangle;
	struct xt_table		*iptable_raw;
76
	struct xt_table		*arptable_filter;
77
#ifdef CONFIG_SECURITY
78
	struct xt_table		*iptable_security;
79
#endif
80
	struct xt_table		*nat_table;
81
#endif
82 83 84 85 86 87 88

	int sysctl_icmp_echo_ignore_all;
	int sysctl_icmp_echo_ignore_broadcasts;
	int sysctl_icmp_ignore_bogus_error_responses;
	int sysctl_icmp_ratelimit;
	int sysctl_icmp_ratemask;
	int sysctl_icmp_errors_use_inbound_ifaddr;
89

90
	struct local_ports ip_local_ports;
91

92
	int sysctl_tcp_ecn;
93 94
	int sysctl_tcp_ecn_fallback;

95
	int sysctl_ip_default_ttl;
96
	int sysctl_ip_no_pmtu_disc;
97
	int sysctl_ip_fwd_use_pmtu;
98
	int sysctl_ip_nonlocal_bind;
99 100
	/* Shall we try to damage output packets if routing dev changes? */
	int sysctl_ip_dynaddr;
101
	int sysctl_ip_early_demux;
102 103
	int sysctl_tcp_early_demux;
	int sysctl_udp_early_demux;
104

105
	int sysctl_fwmark_reflect;
106
	int sysctl_tcp_fwmark_accept;
107 108 109
#ifdef CONFIG_NET_L3_MASTER_DEV
	int sysctl_tcp_l3mdev_accept;
#endif
F
Fan Du 已提交
110 111
	int sysctl_tcp_mtu_probing;
	int sysctl_tcp_base_mss;
112
	int sysctl_tcp_probe_threshold;
113
	u32 sysctl_tcp_probe_interval;
114

115
	int sysctl_tcp_keepalive_time;
116
	int sysctl_tcp_keepalive_probes;
117
	int sysctl_tcp_keepalive_intvl;
118

119
	int sysctl_tcp_syn_retries;
120
	int sysctl_tcp_synack_retries;
121
	int sysctl_tcp_syncookies;
122
	int sysctl_tcp_reordering;
123
	int sysctl_tcp_retries1;
124
	int sysctl_tcp_retries2;
125
	int sysctl_tcp_orphan_retries;
126
	int sysctl_tcp_fin_timeout;
127
	unsigned int sysctl_tcp_notsent_lowat;
128
	int sysctl_tcp_tw_reuse;
E
Eric Dumazet 已提交
129
	int sysctl_tcp_sack;
130
	int sysctl_tcp_window_scaling;
131
	int sysctl_tcp_timestamps;
132
	int sysctl_tcp_early_retrans;
133
	int sysctl_tcp_recovery;
134
	int sysctl_tcp_thin_linear_timeouts;
135
	int sysctl_tcp_slow_start_after_idle;
136
	int sysctl_tcp_retrans_collapse;
137
	int sysctl_tcp_stdurg;
138
	int sysctl_tcp_rfc1337;
139
	int sysctl_tcp_abort_on_overflow;
E
Eric Dumazet 已提交
140
	int sysctl_tcp_fack;
141
	int sysctl_tcp_max_reordering;
E
Eric Dumazet 已提交
142
	int sysctl_tcp_dsack;
143
	int sysctl_tcp_app_win;
144
	int sysctl_tcp_adv_win_scale;
E
Eric Dumazet 已提交
145
	int sysctl_tcp_frto;
146
	int sysctl_tcp_nometrics_save;
147
	int sysctl_tcp_moderate_rcvbuf;
148
	int sysctl_tcp_tso_win_divisor;
149
	int sysctl_tcp_workaround_signed_windows;
150
	int sysctl_tcp_limit_output_bytes;
151
	int sysctl_tcp_challenge_ack_limit;
152
	int sysctl_tcp_min_tso_segs;
153
	int sysctl_tcp_min_rtt_wlen;
154
	int sysctl_tcp_autocorking;
155
	int sysctl_tcp_invalid_ratelimit;
156
	int sysctl_tcp_pacing_ss_ratio;
157
	int sysctl_tcp_pacing_ca_ratio;
158 159
	int sysctl_tcp_wmem[3];
	int sysctl_tcp_rmem[3];
160
	struct inet_timewait_death_row tcp_death_row;
161
	int sysctl_max_syn_backlog;
162
	int sysctl_tcp_fastopen;
163
	const struct tcp_congestion_ops __rcu  *tcp_congestion_control;
164 165
	struct tcp_fastopen_context __rcu *tcp_fastopen_ctx;
	spinlock_t tcp_fastopen_ctx_lock;
166 167 168
	unsigned int sysctl_tcp_fastopen_blackhole_timeout;
	atomic_t tfo_active_disable_times;
	unsigned long tfo_active_disable_stamp;
169

170 171 172 173
#ifdef CONFIG_NET_L3_MASTER_DEV
	int sysctl_udp_l3mdev_accept;
#endif

174
	int sysctl_igmp_max_memberships;
175
	int sysctl_igmp_max_msf;
176
	int sysctl_igmp_llm_reports;
177
	int sysctl_igmp_qrv;
178

179
	struct ping_group_range ping_group_range;
180

181
	atomic_t dev_addr_genid;
182

183 184
#ifdef CONFIG_SYSCTL
	unsigned long *sysctl_local_reserved_ports;
185
	int sysctl_ip_prot_sock;
186 187
#endif

188
#ifdef CONFIG_IP_MROUTE
189
#ifndef CONFIG_IP_MROUTE_MULTIPLE_TABLES
190
	struct mr_table		*mrt;
191 192 193 194
#else
	struct list_head	mr_tables;
	struct fib_rules_ops	*mr_rules_ops;
#endif
195 196 197
#endif
#ifdef CONFIG_IP_ROUTE_MULTIPATH
	int sysctl_fib_multipath_use_neigh;
198
	int sysctl_fib_multipath_hash_policy;
199
#endif
200

201
	struct fib_notifier_ops	*notifier_ops;
202 203
	unsigned int	fib_seq;	/* protected by rtnl_mutex */

204 205 206
	struct fib_notifier_ops	*ipmr_notifier_ops;
	unsigned int	ipmr_seq;	/* protected by rtnl_mutex */

F
fan.du 已提交
207
	atomic_t	rt_genid;
208 209
};
#endif