blob: c978a31b0f846210b4c2a369af960d5349b5395a [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Daniel Lezcanob0f159d2008-01-10 02:49:06 -08002/*
3 * ipv6 in net namespaces
4 */
5
Daniel Lezcanoe71e0342008-01-10 02:56:03 -08006#include <net/inet_frag.h>
7
Daniel Lezcanob0f159d2008-01-10 02:49:06 -08008#ifndef __NETNS_IPV6_H__
9#define __NETNS_IPV6_H__
Alexey Dobriyan86393e52009-08-29 01:34:49 +000010#include <net/dst_ops.h>
Daniel Lezcanob0f159d2008-01-10 02:49:06 -080011
Daniel Lezcano760f2d02008-01-10 02:53:43 -080012struct ctl_table_header;
13
14struct netns_sysctl_ipv6 {
15#ifdef CONFIG_SYSCTL
Eric W. Biederman6dceb032012-04-19 13:37:09 +000016 struct ctl_table_header *hdr;
17 struct ctl_table_header *route_hdr;
18 struct ctl_table_header *icmp_hdr;
Pavel Emelyanove4a2d5c2008-01-22 06:08:36 -080019 struct ctl_table_header *frags_hdr;
Michal Kubecek8d068872013-02-06 10:46:33 +010020 struct ctl_table_header *xfrm6_hdr;
Daniel Lezcano760f2d02008-01-10 02:53:43 -080021#endif
Daniel Lezcano99bc9c42008-01-10 02:54:53 -080022 int bindv6only;
Daniel Lezcano49905092008-01-10 03:01:01 -080023 int flush_delay;
24 int ip6_rt_max_size;
25 int ip6_rt_gc_min_interval;
26 int ip6_rt_gc_timeout;
27 int ip6_rt_gc_interval;
28 int ip6_rt_gc_elasticity;
29 int ip6_rt_mtu_expires;
30 int ip6_rt_min_advmss;
David Ahernb4bac172018-03-02 08:32:18 -080031 int multipath_hash_policy;
Florent Fourcot6444f722014-01-17 17:15:05 +010032 int flowlabel_consistency;
Tom Herbertcb1ce2e2014-07-01 21:33:10 -070033 int auto_flowlabels;
Daniel Lezcano41a76902008-01-10 03:02:40 -080034 int icmpv6_time;
FX Le Bailec35b612014-01-13 15:59:01 +010035 int anycast_src_echo_reply;
Tom Herbert35a256f2015-07-08 16:58:22 -070036 int ip_nonlocal_bind;
Lorenzo Colittie1108612014-05-13 10:17:33 -070037 int fwmark_reflect;
Hannes Frederic Sowa1855b7c2015-03-23 23:36:05 +010038 int idgen_retries;
39 int idgen_delay;
Tom Herbert82a584b2015-04-29 15:33:21 -070040 int flowlabel_state_ranges;
Jakub Sitnicki22b67222017-08-23 09:55:41 +020041 int flowlabel_reflect;
Tom Herbert47d3d7a2017-10-30 14:16:00 -070042 int max_dst_opts_cnt;
43 int max_hbh_opts_cnt;
44 int max_dst_opts_len;
45 int max_hbh_opts_len;
Ahmed Abdelsalamb5facfd2018-04-24 20:23:16 +020046 int seg6_flowlabel;
Daniel Lezcano760f2d02008-01-10 02:53:43 -080047};
48
Daniel Lezcanob0f159d2008-01-10 02:49:06 -080049struct netns_ipv6 {
Daniel Lezcano760f2d02008-01-10 02:53:43 -080050 struct netns_sysctl_ipv6 sysctl;
Pavel Emelyanove0da5a42008-01-10 17:42:55 -080051 struct ipv6_devconf *devconf_all;
52 struct ipv6_devconf *devconf_dflt;
Gao fengc8a627e2012-06-08 01:20:41 +000053 struct inet_peer_base *peers;
Pavel Emelyanovac18e752008-01-22 06:02:14 -080054 struct netns_frags frags;
Alexey Dobriyan8280aa62008-01-31 04:04:13 -080055#ifdef CONFIG_NETFILTER
56 struct xt_table *ip6table_filter;
57 struct xt_table *ip6table_mangle;
58 struct xt_table *ip6table_raw;
Alexey Dobriyane9d38972010-01-18 08:08:37 +010059#ifdef CONFIG_SECURITY
James Morris17e6e592008-06-09 15:58:05 -070060 struct xt_table *ip6table_security;
Alexey Dobriyan8280aa62008-01-31 04:04:13 -080061#endif
Patrick McHardy58a317f2012-08-26 19:14:12 +020062 struct xt_table *ip6table_nat;
Alexey Dobriyane9d38972010-01-18 08:08:37 +010063#endif
David Ahern8d1c8022018-04-17 17:33:26 -070064 struct fib6_info *fib6_null_entry;
David Ahern421842e2018-04-17 17:33:18 -070065 struct rt6_info *ip6_null_entry;
Benjamin Theryc5728722008-03-03 23:34:17 -080066 struct rt6_statistics *rt6_stats;
Stephen Hemminger417f28b2008-07-22 14:33:45 -070067 struct timer_list ip6_fib_timer;
Daniel Lezcano58f09b72008-03-03 23:25:27 -080068 struct hlist_head *fib_table_hash;
69 struct fib6_table *fib6_main_tbl;
Michal Kubeček9a03cd82016-03-08 14:44:35 +010070 struct list_head fib6_walkers;
Alexey Dobriyan86393e52009-08-29 01:34:49 +000071 struct dst_ops ip6_dst_ops;
Michal Kubeček9a03cd82016-03-08 14:44:35 +010072 rwlock_t fib6_walker_lock;
Michal Kubeček3dc94f92016-03-08 14:44:45 +010073 spinlock_t fib6_gc_lock;
Benjamin Thery6891a342008-03-04 13:49:47 -080074 unsigned int ip6_rt_gc_expire;
75 unsigned long ip6_rt_last_gc;
Daniel Lezcano58f09b72008-03-03 23:25:27 -080076#ifdef CONFIG_IPV6_MULTIPLE_TABLES
Roopa Prabhu5e5d6fe2018-02-28 22:43:22 -050077 unsigned int fib6_rules_require_fldissect;
78 bool fib6_has_custom_rules;
Daniel Lezcano8ed67782008-03-04 13:48:30 -080079 struct rt6_info *ip6_prohibit_entry;
80 struct rt6_info *ip6_blk_hole_entry;
Daniel Lezcano58f09b72008-03-03 23:25:27 -080081 struct fib6_table *fib6_local_tbl;
Daniel Lezcanodcabb812008-03-03 23:33:08 -080082 struct fib_rules_ops *fib6_rules_ops;
Daniel Lezcano58f09b72008-03-03 23:25:27 -080083#endif
Denis V. Lunev98c6d1b2008-02-29 11:21:22 -080084 struct sock **icmp_sk;
Daniel Lezcano1762f7e2008-03-07 11:15:34 -080085 struct sock *ndisc_sk;
Daniel Lezcano93ec9262008-03-07 11:16:02 -080086 struct sock *tcp_sk;
Daniel Lezcanob8ad0cb2008-03-07 11:16:55 -080087 struct sock *igmp_sk;
Madhu Challa93a714d2015-02-25 09:58:35 -080088 struct sock *mc_autojoin_sk;
Benjamin Therybd91b8b2008-12-10 16:07:08 -080089#ifdef CONFIG_IPV6_MROUTE
Patrick McHardyd1db2752010-05-11 14:40:55 +020090#ifndef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES
Yuval Mintzb70432f2018-02-28 23:29:32 +020091 struct mr_table *mrt6;
Patrick McHardyd1db2752010-05-11 14:40:55 +020092#else
93 struct list_head mr6_tables;
94 struct fib_rules_ops *mr6_rules_ops;
95#endif
Benjamin Therybd91b8b2008-12-10 16:07:08 -080096#endif
Nicolas Dichtel63998ac2013-03-22 06:28:43 +000097 atomic_t dev_addr_genid;
Hannes Frederic Sowa812918c2014-10-06 19:58:37 +020098 atomic_t fib6_sernum;
David Lebrun915d7e52016-11-08 14:57:40 +010099 struct seg6_pernet_data *seg6_data;
Ido Schimmel16ab6d72017-08-03 13:28:16 +0200100 struct fib_notifier_ops *notifier_ops;
Yuval Mintz088aa3e2018-03-26 15:01:34 +0300101 struct fib_notifier_ops *ip6mr_notifier_ops;
102 unsigned int ipmr_seq; /* protected by rtnl_mutex */
Eric Dumazeta90c9342017-09-19 16:27:06 -0700103 struct {
104 struct hlist_head head;
105 spinlock_t lock;
106 u32 seq;
107 } ip6addrlbl_table;
Daniel Lezcanob0f159d2008-01-10 02:49:06 -0800108};
Amerigo Wangc038a762012-09-18 16:50:08 +0000109
110#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
111struct netns_nf_frag {
112 struct netns_sysctl_ipv6 sysctl;
113 struct netns_frags frags;
114};
115#endif
116
Daniel Lezcanob0f159d2008-01-10 02:49:06 -0800117#endif