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;
43 struct ctl_table_header *forw_hdr;
44 struct ctl_table_header *frags_hdr;
45 struct ctl_table_header *ipv4_hdr;
46 struct ctl_table_header *route_hdr;
47 struct ctl_table_header *xfrm4_hdr;
49 struct ipv4_devconf *devconf_all;
50 struct ipv4_devconf *devconf_dflt;
51 #ifdef CONFIG_IP_MULTIPLE_TABLES
52 struct fib_rules_ops *rules_ops;
53 bool fib_has_custom_rules;
54 struct fib_table __rcu *fib_main;
55 struct fib_table __rcu *fib_default;
57 #ifdef CONFIG_IP_ROUTE_CLASSID
58 int fib_num_tclassid_users;
60 struct hlist_head *fib_table_hash;
61 bool fib_offload_disabled;
64 struct sock * __percpu *icmp_sk;
65 struct sock *mc_autojoin_sk;
67 struct inet_peer_base *peers;
68 struct sock * __percpu *tcp_sk;
69 struct netns_frags frags;
70 #ifdef CONFIG_NETFILTER
71 struct xt_table *iptable_filter;
72 struct xt_table *iptable_mangle;
73 struct xt_table *iptable_raw;
74 struct xt_table *arptable_filter;
75 #ifdef CONFIG_SECURITY
76 struct xt_table *iptable_security;
78 struct xt_table *nat_table;
81 int sysctl_icmp_echo_ignore_all;
82 int sysctl_icmp_echo_ignore_broadcasts;
83 int sysctl_icmp_ignore_bogus_error_responses;
84 int sysctl_icmp_ratelimit;
85 int sysctl_icmp_ratemask;
86 int sysctl_icmp_errors_use_inbound_ifaddr;
88 struct local_ports ip_local_ports;
91 int sysctl_tcp_ecn_fallback;
93 int sysctl_ip_default_ttl;
94 int sysctl_ip_no_pmtu_disc;
95 int sysctl_ip_fwd_use_pmtu;
96 int sysctl_ip_nonlocal_bind;
97 /* Shall we try to damage output packets if routing dev changes? */
98 int sysctl_ip_dynaddr;
99 int sysctl_ip_early_demux;
100 int sysctl_tcp_early_demux;
101 int sysctl_udp_early_demux;
103 int sysctl_fwmark_reflect;
104 int sysctl_tcp_fwmark_accept;
105 #ifdef CONFIG_NET_L3_MASTER_DEV
106 int sysctl_tcp_l3mdev_accept;
108 int sysctl_tcp_mtu_probing;
109 int sysctl_tcp_base_mss;
110 int sysctl_tcp_min_snd_mss;
111 int sysctl_tcp_probe_threshold;
112 u32 sysctl_tcp_probe_interval;
114 int sysctl_tcp_keepalive_time;
115 int sysctl_tcp_keepalive_probes;
116 int sysctl_tcp_keepalive_intvl;
118 int sysctl_tcp_syn_retries;
119 int sysctl_tcp_synack_retries;
120 int sysctl_tcp_syncookies;
121 int sysctl_tcp_reordering;
122 int sysctl_tcp_retries1;
123 int sysctl_tcp_retries2;
124 int sysctl_tcp_orphan_retries;
125 int sysctl_tcp_fin_timeout;
126 unsigned int sysctl_tcp_notsent_lowat;
127 int sysctl_tcp_tw_reuse;
129 int sysctl_tcp_window_scaling;
130 int sysctl_tcp_timestamps;
131 struct inet_timewait_death_row tcp_death_row;
132 int sysctl_max_syn_backlog;
134 #ifdef CONFIG_NET_L3_MASTER_DEV
135 int sysctl_udp_l3mdev_accept;
138 int sysctl_igmp_max_memberships;
139 int sysctl_igmp_max_msf;
140 int sysctl_igmp_llm_reports;
143 struct ping_group_range ping_group_range;
145 atomic_t dev_addr_genid;
148 unsigned long *sysctl_local_reserved_ports;
149 int sysctl_ip_prot_sock;
152 #ifdef CONFIG_IP_MROUTE
153 #ifndef CONFIG_IP_MROUTE_MULTIPLE_TABLES
154 struct mr_table *mrt;
156 struct list_head mr_tables;
157 struct fib_rules_ops *mr_rules_ops;
160 #ifdef CONFIG_IP_ROUTE_MULTIPATH
161 int sysctl_fib_multipath_use_neigh;
162 int sysctl_fib_multipath_hash_policy;
165 struct fib_notifier_ops *notifier_ops;
166 unsigned int fib_seq; /* protected by rtnl_mutex */
169 siphash_key_t ip_id_key;