xref: /OK3568_Linux_fs/kernel/include/net/netns/ipv6.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * ipv6 in net namespaces
4*4882a593Smuzhiyun  */
5*4882a593Smuzhiyun 
6*4882a593Smuzhiyun #include <net/inet_frag.h>
7*4882a593Smuzhiyun 
8*4882a593Smuzhiyun #ifndef __NETNS_IPV6_H__
9*4882a593Smuzhiyun #define __NETNS_IPV6_H__
10*4882a593Smuzhiyun #include <linux/android_kabi.h>
11*4882a593Smuzhiyun #include <net/dst_ops.h>
12*4882a593Smuzhiyun #include <uapi/linux/icmpv6.h>
13*4882a593Smuzhiyun 
14*4882a593Smuzhiyun struct ctl_table_header;
15*4882a593Smuzhiyun 
16*4882a593Smuzhiyun struct netns_sysctl_ipv6 {
17*4882a593Smuzhiyun #ifdef CONFIG_SYSCTL
18*4882a593Smuzhiyun 	struct ctl_table_header *hdr;
19*4882a593Smuzhiyun 	struct ctl_table_header *route_hdr;
20*4882a593Smuzhiyun 	struct ctl_table_header *icmp_hdr;
21*4882a593Smuzhiyun 	struct ctl_table_header *frags_hdr;
22*4882a593Smuzhiyun 	struct ctl_table_header *xfrm6_hdr;
23*4882a593Smuzhiyun #endif
24*4882a593Smuzhiyun 	int bindv6only;
25*4882a593Smuzhiyun 	int flush_delay;
26*4882a593Smuzhiyun 	int ip6_rt_max_size;
27*4882a593Smuzhiyun 	int ip6_rt_gc_min_interval;
28*4882a593Smuzhiyun 	int ip6_rt_gc_timeout;
29*4882a593Smuzhiyun 	int ip6_rt_gc_interval;
30*4882a593Smuzhiyun 	int ip6_rt_gc_elasticity;
31*4882a593Smuzhiyun 	int ip6_rt_mtu_expires;
32*4882a593Smuzhiyun 	int ip6_rt_min_advmss;
33*4882a593Smuzhiyun 	int multipath_hash_policy;
34*4882a593Smuzhiyun 	int flowlabel_consistency;
35*4882a593Smuzhiyun 	int auto_flowlabels;
36*4882a593Smuzhiyun 	int icmpv6_time;
37*4882a593Smuzhiyun 	int icmpv6_echo_ignore_all;
38*4882a593Smuzhiyun 	int icmpv6_echo_ignore_multicast;
39*4882a593Smuzhiyun 	int icmpv6_echo_ignore_anycast;
40*4882a593Smuzhiyun 	DECLARE_BITMAP(icmpv6_ratemask, ICMPV6_MSG_MAX + 1);
41*4882a593Smuzhiyun 	unsigned long *icmpv6_ratemask_ptr;
42*4882a593Smuzhiyun 	int anycast_src_echo_reply;
43*4882a593Smuzhiyun 	int ip_nonlocal_bind;
44*4882a593Smuzhiyun 	int fwmark_reflect;
45*4882a593Smuzhiyun 	int idgen_retries;
46*4882a593Smuzhiyun 	int idgen_delay;
47*4882a593Smuzhiyun 	int flowlabel_state_ranges;
48*4882a593Smuzhiyun 	int flowlabel_reflect;
49*4882a593Smuzhiyun 	int max_dst_opts_cnt;
50*4882a593Smuzhiyun 	int max_hbh_opts_cnt;
51*4882a593Smuzhiyun 	int max_dst_opts_len;
52*4882a593Smuzhiyun 	int max_hbh_opts_len;
53*4882a593Smuzhiyun 	int seg6_flowlabel;
54*4882a593Smuzhiyun 	bool skip_notify_on_dev_down;
55*4882a593Smuzhiyun };
56*4882a593Smuzhiyun 
57*4882a593Smuzhiyun struct netns_ipv6 {
58*4882a593Smuzhiyun 	struct netns_sysctl_ipv6 sysctl;
59*4882a593Smuzhiyun 	struct ipv6_devconf	*devconf_all;
60*4882a593Smuzhiyun 	struct ipv6_devconf	*devconf_dflt;
61*4882a593Smuzhiyun 	struct inet_peer_base	*peers;
62*4882a593Smuzhiyun 	struct fqdir		*fqdir;
63*4882a593Smuzhiyun #ifdef CONFIG_NETFILTER
64*4882a593Smuzhiyun 	struct xt_table		*ip6table_filter;
65*4882a593Smuzhiyun 	struct xt_table		*ip6table_mangle;
66*4882a593Smuzhiyun 	struct xt_table		*ip6table_raw;
67*4882a593Smuzhiyun #ifdef CONFIG_SECURITY
68*4882a593Smuzhiyun 	struct xt_table		*ip6table_security;
69*4882a593Smuzhiyun #endif
70*4882a593Smuzhiyun 	struct xt_table		*ip6table_nat;
71*4882a593Smuzhiyun #endif
72*4882a593Smuzhiyun 	struct fib6_info	*fib6_null_entry;
73*4882a593Smuzhiyun 	struct rt6_info		*ip6_null_entry;
74*4882a593Smuzhiyun 	struct rt6_statistics   *rt6_stats;
75*4882a593Smuzhiyun 	struct timer_list       ip6_fib_timer;
76*4882a593Smuzhiyun 	struct hlist_head       *fib_table_hash;
77*4882a593Smuzhiyun 	struct fib6_table       *fib6_main_tbl;
78*4882a593Smuzhiyun 	struct list_head	fib6_walkers;
79*4882a593Smuzhiyun 	struct dst_ops		ip6_dst_ops;
80*4882a593Smuzhiyun 	rwlock_t		fib6_walker_lock;
81*4882a593Smuzhiyun 	spinlock_t		fib6_gc_lock;
82*4882a593Smuzhiyun 	unsigned int		 ip6_rt_gc_expire;
83*4882a593Smuzhiyun 	unsigned long		 ip6_rt_last_gc;
84*4882a593Smuzhiyun #ifdef CONFIG_IPV6_MULTIPLE_TABLES
85*4882a593Smuzhiyun 	unsigned int		fib6_rules_require_fldissect;
86*4882a593Smuzhiyun 	bool			fib6_has_custom_rules;
87*4882a593Smuzhiyun #ifdef CONFIG_IPV6_SUBTREES
88*4882a593Smuzhiyun 	unsigned int		fib6_routes_require_src;
89*4882a593Smuzhiyun #endif
90*4882a593Smuzhiyun 	struct rt6_info         *ip6_prohibit_entry;
91*4882a593Smuzhiyun 	struct rt6_info         *ip6_blk_hole_entry;
92*4882a593Smuzhiyun 	struct fib6_table       *fib6_local_tbl;
93*4882a593Smuzhiyun 	struct fib_rules_ops    *fib6_rules_ops;
94*4882a593Smuzhiyun #endif
95*4882a593Smuzhiyun 	struct sock * __percpu	*icmp_sk;
96*4882a593Smuzhiyun 	struct sock             *ndisc_sk;
97*4882a593Smuzhiyun 	struct sock             *tcp_sk;
98*4882a593Smuzhiyun 	struct sock             *igmp_sk;
99*4882a593Smuzhiyun 	struct sock		*mc_autojoin_sk;
100*4882a593Smuzhiyun #ifdef CONFIG_IPV6_MROUTE
101*4882a593Smuzhiyun #ifndef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES
102*4882a593Smuzhiyun 	struct mr_table		*mrt6;
103*4882a593Smuzhiyun #else
104*4882a593Smuzhiyun 	struct list_head	mr6_tables;
105*4882a593Smuzhiyun 	struct fib_rules_ops	*mr6_rules_ops;
106*4882a593Smuzhiyun #endif
107*4882a593Smuzhiyun #endif
108*4882a593Smuzhiyun 	atomic_t		dev_addr_genid;
109*4882a593Smuzhiyun 	atomic_t		fib6_sernum;
110*4882a593Smuzhiyun 	struct seg6_pernet_data *seg6_data;
111*4882a593Smuzhiyun 	struct fib_notifier_ops	*notifier_ops;
112*4882a593Smuzhiyun 	struct fib_notifier_ops	*ip6mr_notifier_ops;
113*4882a593Smuzhiyun 	unsigned int ipmr_seq; /* protected by rtnl_mutex */
114*4882a593Smuzhiyun 	struct {
115*4882a593Smuzhiyun 		struct hlist_head head;
116*4882a593Smuzhiyun 		spinlock_t	lock;
117*4882a593Smuzhiyun 		u32		seq;
118*4882a593Smuzhiyun 	} ip6addrlbl_table;
119*4882a593Smuzhiyun 
120*4882a593Smuzhiyun 	ANDROID_KABI_RESERVE(1);
121*4882a593Smuzhiyun };
122*4882a593Smuzhiyun 
123*4882a593Smuzhiyun #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
124*4882a593Smuzhiyun struct netns_nf_frag {
125*4882a593Smuzhiyun 	struct fqdir	*fqdir;
126*4882a593Smuzhiyun };
127*4882a593Smuzhiyun #endif
128*4882a593Smuzhiyun 
129*4882a593Smuzhiyun #endif
130