blob: d061ffeb1e71204c490abed907004804036030e0 [file] [log] [blame]
Pavel Emelyanov8afd3512007-12-16 13:29:36 -08001/*
2 * ipv4 in net namespaces
3 */
4
5#ifndef __NETNS_IPV4_H__
6#define __NETNS_IPV4_H__
Denis V. Luneve4e49712008-01-10 03:27:51 -08007
Eric W. Biederman7064d162012-05-24 10:34:21 -06008#include <linux/uidgid.h>
Pavel Emelyanovac18e752008-01-22 06:02:14 -08009#include <net/inet_frag.h>
Alexander Duycka7e53532015-03-04 15:02:44 -080010#include <linux/rcupdate.h>
Pavel Emelyanovac18e752008-01-22 06:02:14 -080011
David S. Miller51c5d0c2012-07-10 00:49:14 -070012struct tcpm_hash_bucket;
Pavel Emelyanov752d14d2007-12-16 13:31:47 -080013struct ctl_table_header;
14struct ipv4_devconf;
Denis V. Luneve4e49712008-01-10 03:27:51 -080015struct fib_rules_ops;
Denis V. Luneve4aef8a2008-01-10 03:28:24 -080016struct hlist_head;
David S. Millerf4530fa2012-07-05 22:13:13 -070017struct fib_table;
Denis V. Lunev6bd48fc2008-01-10 03:28:55 -080018struct sock;
Eric W. Biederman0bbf87d2013-09-28 14:10:59 -070019struct local_ports {
20 seqlock_t lock;
21 int range[2];
Eric Dumazeted2dfd92015-05-27 11:34:37 -070022 bool warned;
Eric W. Biederman0bbf87d2013-09-28 14:10:59 -070023};
Pavel Emelyanov752d14d2007-12-16 13:31:47 -080024
Cong Wangba6b9182014-05-06 11:02:50 -070025struct ping_group_range {
26 seqlock_t lock;
27 kgid_t range[2];
28};
29
Pavel Emelyanov8afd3512007-12-16 13:29:36 -080030struct netns_ipv4 {
Eric Dumazet2a75de02008-01-05 23:08:49 -080031#ifdef CONFIG_SYSCTL
Pavel Emelyanov752d14d2007-12-16 13:31:47 -080032 struct ctl_table_header *forw_hdr;
Pavel Emelyanove4a2d5c2008-01-22 06:08:36 -080033 struct ctl_table_header *frags_hdr;
Pavel Emelyanov68528f02008-03-26 01:56:24 -070034 struct ctl_table_header *ipv4_hdr;
Denis V. Lunev39a23e72008-07-05 19:02:33 -070035 struct ctl_table_header *route_hdr;
Michal Kubecek8d068872013-02-06 10:46:33 +010036 struct ctl_table_header *xfrm4_hdr;
Eric Dumazet2a75de02008-01-05 23:08:49 -080037#endif
Pavel Emelyanov752d14d2007-12-16 13:31:47 -080038 struct ipv4_devconf *devconf_all;
39 struct ipv4_devconf *devconf_dflt;
Denis V. Luneve4e49712008-01-10 03:27:51 -080040#ifdef CONFIG_IP_MULTIPLE_TABLES
41 struct fib_rules_ops *rules_ops;
David S. Millerf4530fa2012-07-05 22:13:13 -070042 bool fib_has_custom_rules;
Alexander Duycka7e53532015-03-04 15:02:44 -080043 struct fib_table __rcu *fib_local;
44 struct fib_table __rcu *fib_main;
45 struct fib_table __rcu *fib_default;
David S. Millerf4530fa2012-07-05 22:13:13 -070046#endif
47#ifdef CONFIG_IP_ROUTE_CLASSID
48 int fib_num_tclassid_users;
Denis V. Luneve4e49712008-01-10 03:27:51 -080049#endif
Denis V. Luneve4aef8a2008-01-10 03:28:24 -080050 struct hlist_head *fib_table_hash;
Scott Feldman448b1282015-03-05 21:21:18 -080051 bool fib_offload_disabled;
Denis V. Lunev6bd48fc2008-01-10 03:28:55 -080052 struct sock *fibnl;
Pavel Emelyanovac18e752008-01-22 06:02:14 -080053
Eric Dumazet349c9e32015-01-29 15:58:09 -080054 struct sock * __percpu *icmp_sk;
Madhu Challa93a714d2015-02-25 09:58:35 -080055 struct sock *mc_autojoin_sk;
Eric Dumazet349c9e32015-01-29 15:58:09 -080056
Gao fengc8a627e2012-06-08 01:20:41 +000057 struct inet_peer_base *peers;
Eric Dumazetbdbbb852015-01-29 21:35:05 -080058 struct sock * __percpu *tcp_sk;
Pavel Emelyanovac18e752008-01-22 06:02:14 -080059 struct netns_frags frags;
Alexey Dobriyan9335f042008-01-31 04:03:23 -080060#ifdef CONFIG_NETFILTER
61 struct xt_table *iptable_filter;
62 struct xt_table *iptable_mangle;
63 struct xt_table *iptable_raw;
Alexey Dobriyan9ea0cb22008-01-31 04:05:09 -080064 struct xt_table *arptable_filter;
Alexey Dobriyane9d38972010-01-18 08:08:37 +010065#ifdef CONFIG_SECURITY
James Morris560ee652008-06-09 15:57:24 -070066 struct xt_table *iptable_security;
Alexey Dobriyane9d38972010-01-18 08:08:37 +010067#endif
Alexey Dobriyane099a172008-10-08 11:35:10 +020068 struct xt_table *nat_table;
Alexey Dobriyan9335f042008-01-31 04:03:23 -080069#endif
Pavel Emelyanova24022e2008-03-26 01:55:37 -070070
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. Lunev9f5e97e2008-07-05 19:02:59 -070077
Cong Wangc9d8f1a2014-05-06 11:02:49 -070078 struct local_ports ip_local_ports;
Eric W. Biederman0bbf87d2013-09-28 14:10:59 -070079
Hannes Frederic Sowa5d134f12013-01-05 16:10:48 +000080 int sysctl_tcp_ecn;
Daniel Borkmann49213552015-05-19 21:04:22 +020081 int sysctl_tcp_ecn_fallback;
82
Nikolay Borisovfa50d972016-02-15 12:11:27 +020083 int sysctl_ip_default_ttl;
Hannes Frederic Sowa974eda12013-12-14 05:13:38 +010084 int sysctl_ip_no_pmtu_disc;
Hannes Frederic Sowaf87c10a2014-01-09 10:01:15 +010085 int sysctl_ip_fwd_use_pmtu;
Vincent Bernat49a60152014-09-05 15:09:03 +020086 int sysctl_ip_nonlocal_bind;
Nikolay Borisov287b7f32016-02-15 12:11:29 +020087 /* Shall we try to damage output packets if routing dev changes? */
88 int sysctl_ip_dynaddr;
Nikolay Borisove21145a2016-02-15 12:11:30 +020089 int sysctl_ip_early_demux;
Hannes Frederic Sowa5d134f12013-01-05 16:10:48 +000090
Lorenzo Colittie1108612014-05-13 10:17:33 -070091 int sysctl_fwmark_reflect;
Lorenzo Colitti84f39b02014-05-13 10:17:35 -070092 int sysctl_tcp_fwmark_accept;
David Ahern6dd9a142015-12-16 13:20:44 -080093#ifdef CONFIG_NET_L3_MASTER_DEV
94 int sysctl_tcp_l3mdev_accept;
95#endif
Fan Dub0f9ca52015-02-10 09:53:16 +080096 int sysctl_tcp_mtu_probing;
97 int sysctl_tcp_base_mss;
Fan Du6b58e0a2015-03-06 11:18:23 +080098 int sysctl_tcp_probe_threshold;
Fan Du05cbc0d2015-03-06 11:18:24 +080099 u32 sysctl_tcp_probe_interval;
Lorenzo Colittie1108612014-05-13 10:17:33 -0700100
Nikolay Borisov13b287e2016-01-07 16:38:43 +0200101 int sysctl_tcp_keepalive_time;
Nikolay Borisov9bd68612016-01-07 16:38:44 +0200102 int sysctl_tcp_keepalive_probes;
Nikolay Borisovb840d152016-01-07 16:38:45 +0200103 int sysctl_tcp_keepalive_intvl;
Nikolay Borisov13b287e2016-01-07 16:38:43 +0200104
Nikolay Borisov6fa25162016-02-03 09:46:49 +0200105 int sysctl_tcp_syn_retries;
Nikolay Borisov7c083ec2016-02-03 09:46:50 +0200106 int sysctl_tcp_synack_retries;
Nikolay Borisov12ed8242016-02-03 09:46:51 +0200107 int sysctl_tcp_syncookies;
Nikolay Borisov1043e252016-02-03 09:46:52 +0200108 int sysctl_tcp_reordering;
Nikolay Borisovae5c3f42016-02-03 09:46:53 +0200109 int sysctl_tcp_retries1;
Nikolay Borisovc6214a92016-02-03 09:46:54 +0200110 int sysctl_tcp_retries2;
Nikolay Borisovc402d9b2016-02-03 09:46:55 +0200111 int sysctl_tcp_orphan_retries;
Nikolay Borisov1e579ca2016-02-03 09:46:56 +0200112 int sysctl_tcp_fin_timeout;
Nikolay Borisov4979f2d2016-02-03 09:46:57 +0200113 unsigned int sysctl_tcp_notsent_lowat;
Nikolay Borisov12ed8242016-02-03 09:46:51 +0200114
Nikolay Borisov815c5272016-02-08 23:29:21 +0200115 int sysctl_igmp_max_memberships;
Nikolay Borisov166b6b22016-02-08 23:29:22 +0200116 int sysctl_igmp_max_msf;
Nikolay Borisov87a8a2a2016-02-09 00:13:50 +0200117 int sysctl_igmp_llm_reports;
Nikolay Borisov165094a2016-02-08 23:29:24 +0200118 int sysctl_igmp_qrv;
Nikolay Borisov815c5272016-02-08 23:29:21 +0200119
Cong Wangba6b9182014-05-06 11:02:50 -0700120 struct ping_group_range ping_group_range;
Vasiliy Kulikovc319b4d2011-05-13 10:01:00 +0000121
David S. Miller436c3b62011-03-24 17:42:21 -0700122 atomic_t dev_addr_genid;
Benjamin Thery70a269e2009-01-22 04:56:15 +0000123
WANG Cong122ff242014-05-12 16:04:53 -0700124#ifdef CONFIG_SYSCTL
125 unsigned long *sysctl_local_reserved_ports;
126#endif
127
Benjamin Thery70a269e2009-01-22 04:56:15 +0000128#ifdef CONFIG_IP_MROUTE
Patrick McHardyf0ad0862010-04-13 05:03:23 +0000129#ifndef CONFIG_IP_MROUTE_MULTIPLE_TABLES
Patrick McHardy0c122952010-04-13 05:03:22 +0000130 struct mr_table *mrt;
Patrick McHardyf0ad0862010-04-13 05:03:23 +0000131#else
132 struct list_head mr_tables;
133 struct fib_rules_ops *mr_rules_ops;
134#endif
Benjamin Thery70a269e2009-01-22 04:56:15 +0000135#endif
David Aherna6db4492016-04-07 07:21:00 -0700136#ifdef CONFIG_IP_ROUTE_MULTIPATH
137 int sysctl_fib_multipath_use_neigh;
138#endif
fan.duca4c3fc2013-07-30 08:33:53 +0800139 atomic_t rt_genid;
Pavel Emelyanov8afd3512007-12-16 13:29:36 -0800140};
141#endif