Pavel Emelyanov | 8afd351 | 2007-12-16 13:29:36 -0800 | [diff] [blame] | 1 | /* |
2 | * ipv4 in net namespaces | ||||
3 | */ | ||||
4 | |||||
5 | #ifndef __NETNS_IPV4_H__ | ||||
6 | #define __NETNS_IPV4_H__ | ||||
Denis V. Lunev | e4e4971 | 2008-01-10 03:27:51 -0800 | [diff] [blame] | 7 | |
Eric W. Biederman | 7064d16 | 2012-05-24 10:34:21 -0600 | [diff] [blame] | 8 | #include <linux/uidgid.h> |
Pavel Emelyanov | ac18e75 | 2008-01-22 06:02:14 -0800 | [diff] [blame] | 9 | #include <net/inet_frag.h> |
Alexander Duyck | a7e5353 | 2015-03-04 15:02:44 -0800 | [diff] [blame] | 10 | #include <linux/rcupdate.h> |
Pavel Emelyanov | ac18e75 | 2008-01-22 06:02:14 -0800 | [diff] [blame] | 11 | |
David S. Miller | 51c5d0c | 2012-07-10 00:49:14 -0700 | [diff] [blame] | 12 | struct tcpm_hash_bucket; |
Pavel Emelyanov | 752d14d | 2007-12-16 13:31:47 -0800 | [diff] [blame] | 13 | struct ctl_table_header; |
14 | struct ipv4_devconf; | ||||
Denis V. Lunev | e4e4971 | 2008-01-10 03:27:51 -0800 | [diff] [blame] | 15 | struct fib_rules_ops; |
Denis V. Lunev | e4aef8a | 2008-01-10 03:28:24 -0800 | [diff] [blame] | 16 | struct hlist_head; |
David S. Miller | f4530fa | 2012-07-05 22:13:13 -0700 | [diff] [blame] | 17 | struct fib_table; |
Denis V. Lunev | 6bd48fc | 2008-01-10 03:28:55 -0800 | [diff] [blame] | 18 | struct sock; |
Eric W. Biederman | 0bbf87d | 2013-09-28 14:10:59 -0700 | [diff] [blame] | 19 | struct local_ports { |
20 | seqlock_t lock; | ||||
21 | int range[2]; | ||||
Eric Dumazet | ed2dfd9 | 2015-05-27 11:34:37 -0700 | [diff] [blame] | 22 | bool warned; |
Eric W. Biederman | 0bbf87d | 2013-09-28 14:10:59 -0700 | [diff] [blame] | 23 | }; |
Pavel Emelyanov | 752d14d | 2007-12-16 13:31:47 -0800 | [diff] [blame] | 24 | |
Cong Wang | ba6b918 | 2014-05-06 11:02:50 -0700 | [diff] [blame] | 25 | struct ping_group_range { |
26 | seqlock_t lock; | ||||
27 | kgid_t range[2]; | ||||
28 | }; | ||||
29 | |||||
Pavel Emelyanov | 8afd351 | 2007-12-16 13:29:36 -0800 | [diff] [blame] | 30 | struct netns_ipv4 { |
Eric Dumazet | 2a75de0 | 2008-01-05 23:08:49 -0800 | [diff] [blame] | 31 | #ifdef CONFIG_SYSCTL |
Pavel Emelyanov | 752d14d | 2007-12-16 13:31:47 -0800 | [diff] [blame] | 32 | struct ctl_table_header *forw_hdr; |
Pavel Emelyanov | e4a2d5c | 2008-01-22 06:08:36 -0800 | [diff] [blame] | 33 | struct ctl_table_header *frags_hdr; |
Pavel Emelyanov | 68528f0 | 2008-03-26 01:56:24 -0700 | [diff] [blame] | 34 | struct ctl_table_header *ipv4_hdr; |
Denis V. Lunev | 39a23e7 | 2008-07-05 19:02:33 -0700 | [diff] [blame] | 35 | struct ctl_table_header *route_hdr; |
Michal Kubecek | 8d06887 | 2013-02-06 10:46:33 +0100 | [diff] [blame] | 36 | struct ctl_table_header *xfrm4_hdr; |
Eric Dumazet | 2a75de0 | 2008-01-05 23:08:49 -0800 | [diff] [blame] | 37 | #endif |
Pavel Emelyanov | 752d14d | 2007-12-16 13:31:47 -0800 | [diff] [blame] | 38 | struct ipv4_devconf *devconf_all; |
39 | struct ipv4_devconf *devconf_dflt; | ||||
Denis V. Lunev | e4e4971 | 2008-01-10 03:27:51 -0800 | [diff] [blame] | 40 | #ifdef CONFIG_IP_MULTIPLE_TABLES |
41 | struct fib_rules_ops *rules_ops; | ||||
David S. Miller | f4530fa | 2012-07-05 22:13:13 -0700 | [diff] [blame] | 42 | bool fib_has_custom_rules; |
Alexander Duyck | a7e5353 | 2015-03-04 15:02:44 -0800 | [diff] [blame] | 43 | struct fib_table __rcu *fib_local; |
44 | struct fib_table __rcu *fib_main; | ||||
45 | struct fib_table __rcu *fib_default; | ||||
David S. Miller | f4530fa | 2012-07-05 22:13:13 -0700 | [diff] [blame] | 46 | #endif |
47 | #ifdef CONFIG_IP_ROUTE_CLASSID | ||||
48 | int fib_num_tclassid_users; | ||||
Denis V. Lunev | e4e4971 | 2008-01-10 03:27:51 -0800 | [diff] [blame] | 49 | #endif |
Denis V. Lunev | e4aef8a | 2008-01-10 03:28:24 -0800 | [diff] [blame] | 50 | struct hlist_head *fib_table_hash; |
Scott Feldman | 448b128 | 2015-03-05 21:21:18 -0800 | [diff] [blame] | 51 | bool fib_offload_disabled; |
Denis V. Lunev | 6bd48fc | 2008-01-10 03:28:55 -0800 | [diff] [blame] | 52 | struct sock *fibnl; |
Pavel Emelyanov | ac18e75 | 2008-01-22 06:02:14 -0800 | [diff] [blame] | 53 | |
Eric Dumazet | 349c9e3 | 2015-01-29 15:58:09 -0800 | [diff] [blame] | 54 | struct sock * __percpu *icmp_sk; |
Madhu Challa | 93a714d | 2015-02-25 09:58:35 -0800 | [diff] [blame] | 55 | struct sock *mc_autojoin_sk; |
Eric Dumazet | 349c9e3 | 2015-01-29 15:58:09 -0800 | [diff] [blame] | 56 | |
Gao feng | c8a627e | 2012-06-08 01:20:41 +0000 | [diff] [blame] | 57 | struct inet_peer_base *peers; |
Eric Dumazet | bdbbb85 | 2015-01-29 21:35:05 -0800 | [diff] [blame] | 58 | struct sock * __percpu *tcp_sk; |
Pavel Emelyanov | ac18e75 | 2008-01-22 06:02:14 -0800 | [diff] [blame] | 59 | struct netns_frags frags; |
Alexey Dobriyan | 9335f04 | 2008-01-31 04:03:23 -0800 | [diff] [blame] | 60 | #ifdef CONFIG_NETFILTER |
61 | struct xt_table *iptable_filter; | ||||
62 | struct xt_table *iptable_mangle; | ||||
63 | struct xt_table *iptable_raw; | ||||
Alexey Dobriyan | 9ea0cb2 | 2008-01-31 04:05:09 -0800 | [diff] [blame] | 64 | struct xt_table *arptable_filter; |
Alexey Dobriyan | e9d3897 | 2010-01-18 08:08:37 +0100 | [diff] [blame] | 65 | #ifdef CONFIG_SECURITY |
James Morris | 560ee65 | 2008-06-09 15:57:24 -0700 | [diff] [blame] | 66 | struct xt_table *iptable_security; |
Alexey Dobriyan | e9d3897 | 2010-01-18 08:08:37 +0100 | [diff] [blame] | 67 | #endif |
Alexey Dobriyan | e099a17 | 2008-10-08 11:35:10 +0200 | [diff] [blame] | 68 | struct xt_table *nat_table; |
Alexey Dobriyan | 9335f04 | 2008-01-31 04:03:23 -0800 | [diff] [blame] | 69 | #endif |
Pavel Emelyanov | a24022e | 2008-03-26 01:55:37 -0700 | [diff] [blame] | 70 | |
71 | int sysctl_icmp_echo_ignore_all; | ||||
72 | int sysctl_icmp_echo_ignore_broadcasts; | ||||
73 | int sysctl_icmp_ignore_bogus_error_responses; | ||||
74 | int sysctl_icmp_ratelimit; | ||||
75 | int sysctl_icmp_ratemask; | ||||
76 | int sysctl_icmp_errors_use_inbound_ifaddr; | ||||
Denis V. Lunev | 9f5e97e | 2008-07-05 19:02:59 -0700 | [diff] [blame] | 77 | |
Cong Wang | c9d8f1a | 2014-05-06 11:02:49 -0700 | [diff] [blame] | 78 | struct local_ports ip_local_ports; |
Eric W. Biederman | 0bbf87d | 2013-09-28 14:10:59 -0700 | [diff] [blame] | 79 | |
Hannes Frederic Sowa | 5d134f1 | 2013-01-05 16:10:48 +0000 | [diff] [blame] | 80 | int sysctl_tcp_ecn; |
Daniel Borkmann | 4921355 | 2015-05-19 21:04:22 +0200 | [diff] [blame] | 81 | int sysctl_tcp_ecn_fallback; |
82 | |||||
Hannes Frederic Sowa | 974eda1 | 2013-12-14 05:13:38 +0100 | [diff] [blame] | 83 | int sysctl_ip_no_pmtu_disc; |
Hannes Frederic Sowa | f87c10a | 2014-01-09 10:01:15 +0100 | [diff] [blame] | 84 | int sysctl_ip_fwd_use_pmtu; |
Vincent Bernat | 49a6015 | 2014-09-05 15:09:03 +0200 | [diff] [blame] | 85 | int sysctl_ip_nonlocal_bind; |
Hannes Frederic Sowa | 5d134f1 | 2013-01-05 16:10:48 +0000 | [diff] [blame] | 86 | |
Lorenzo Colitti | e110861 | 2014-05-13 10:17:33 -0700 | [diff] [blame] | 87 | int sysctl_fwmark_reflect; |
Lorenzo Colitti | 84f39b0 | 2014-05-13 10:17:35 -0700 | [diff] [blame] | 88 | int sysctl_tcp_fwmark_accept; |
David Ahern | 6dd9a14 | 2015-12-16 13:20:44 -0800 | [diff] [blame] | 89 | #ifdef CONFIG_NET_L3_MASTER_DEV |
90 | int sysctl_tcp_l3mdev_accept; | ||||
91 | #endif | ||||
Fan Du | b0f9ca5 | 2015-02-10 09:53:16 +0800 | [diff] [blame] | 92 | int sysctl_tcp_mtu_probing; |
93 | int sysctl_tcp_base_mss; | ||||
Fan Du | 6b58e0a | 2015-03-06 11:18:23 +0800 | [diff] [blame] | 94 | int sysctl_tcp_probe_threshold; |
Fan Du | 05cbc0d | 2015-03-06 11:18:24 +0800 | [diff] [blame] | 95 | u32 sysctl_tcp_probe_interval; |
Lorenzo Colitti | e110861 | 2014-05-13 10:17:33 -0700 | [diff] [blame] | 96 | |
Nikolay Borisov | 13b287e | 2016-01-07 16:38:43 +0200 | [diff] [blame] | 97 | int sysctl_tcp_keepalive_time; |
Nikolay Borisov | 9bd6861 | 2016-01-07 16:38:44 +0200 | [diff] [blame] | 98 | int sysctl_tcp_keepalive_probes; |
Nikolay Borisov | b840d15 | 2016-01-07 16:38:45 +0200 | [diff] [blame] | 99 | int sysctl_tcp_keepalive_intvl; |
Nikolay Borisov | 13b287e | 2016-01-07 16:38:43 +0200 | [diff] [blame] | 100 | |
Nikolay Borisov | 6fa2516 | 2016-02-03 09:46:49 +0200 | [diff] [blame] | 101 | int sysctl_tcp_syn_retries; |
Nikolay Borisov | 7c083ec | 2016-02-03 09:46:50 +0200 | [diff] [blame] | 102 | int sysctl_tcp_synack_retries; |
Nikolay Borisov | 12ed824 | 2016-02-03 09:46:51 +0200 | [diff] [blame] | 103 | int sysctl_tcp_syncookies; |
Nikolay Borisov | 1043e25 | 2016-02-03 09:46:52 +0200 | [diff] [blame] | 104 | int sysctl_tcp_reordering; |
Nikolay Borisov | ae5c3f4 | 2016-02-03 09:46:53 +0200 | [diff] [blame] | 105 | int sysctl_tcp_retries1; |
Nikolay Borisov | c6214a9 | 2016-02-03 09:46:54 +0200 | [diff] [blame] | 106 | int sysctl_tcp_retries2; |
Nikolay Borisov | c402d9b | 2016-02-03 09:46:55 +0200 | [diff] [blame] | 107 | int sysctl_tcp_orphan_retries; |
Nikolay Borisov | 1e579ca | 2016-02-03 09:46:56 +0200 | [diff] [blame] | 108 | int sysctl_tcp_fin_timeout; |
Nikolay Borisov | 4979f2d | 2016-02-03 09:46:57 +0200 | [diff] [blame] | 109 | unsigned int sysctl_tcp_notsent_lowat; |
Nikolay Borisov | 12ed824 | 2016-02-03 09:46:51 +0200 | [diff] [blame] | 110 | |
Nikolay Borisov | 815c527 | 2016-02-08 23:29:21 +0200 | [diff] [blame] | 111 | int sysctl_igmp_max_memberships; |
Nikolay Borisov | 166b6b2 | 2016-02-08 23:29:22 +0200 | [diff] [blame] | 112 | int sysctl_igmp_max_msf; |
Nikolay Borisov | 87a8a2a | 2016-02-09 00:13:50 +0200 | [diff] [blame^] | 113 | int sysctl_igmp_llm_reports; |
Nikolay Borisov | 815c527 | 2016-02-08 23:29:21 +0200 | [diff] [blame] | 114 | |
Cong Wang | ba6b918 | 2014-05-06 11:02:50 -0700 | [diff] [blame] | 115 | struct ping_group_range ping_group_range; |
Vasiliy Kulikov | c319b4d | 2011-05-13 10:01:00 +0000 | [diff] [blame] | 116 | |
David S. Miller | 436c3b6 | 2011-03-24 17:42:21 -0700 | [diff] [blame] | 117 | atomic_t dev_addr_genid; |
Benjamin Thery | 70a269e | 2009-01-22 04:56:15 +0000 | [diff] [blame] | 118 | |
WANG Cong | 122ff24 | 2014-05-12 16:04:53 -0700 | [diff] [blame] | 119 | #ifdef CONFIG_SYSCTL |
120 | unsigned long *sysctl_local_reserved_ports; | ||||
121 | #endif | ||||
122 | |||||
Benjamin Thery | 70a269e | 2009-01-22 04:56:15 +0000 | [diff] [blame] | 123 | #ifdef CONFIG_IP_MROUTE |
Patrick McHardy | f0ad086 | 2010-04-13 05:03:23 +0000 | [diff] [blame] | 124 | #ifndef CONFIG_IP_MROUTE_MULTIPLE_TABLES |
Patrick McHardy | 0c12295 | 2010-04-13 05:03:22 +0000 | [diff] [blame] | 125 | struct mr_table *mrt; |
Patrick McHardy | f0ad086 | 2010-04-13 05:03:23 +0000 | [diff] [blame] | 126 | #else |
127 | struct list_head mr_tables; | ||||
128 | struct fib_rules_ops *mr_rules_ops; | ||||
129 | #endif | ||||
Benjamin Thery | 70a269e | 2009-01-22 04:56:15 +0000 | [diff] [blame] | 130 | #endif |
fan.du | ca4c3fc | 2013-07-30 08:33:53 +0800 | [diff] [blame] | 131 | atomic_t rt_genid; |
Pavel Emelyanov | 8afd351 | 2007-12-16 13:29:36 -0800 | [diff] [blame] | 132 | }; |
133 | #endif |