1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2b0f159dbSDaniel Lezcano /* 3b0f159dbSDaniel Lezcano * ipv6 in net namespaces 4b0f159dbSDaniel Lezcano */ 5b0f159dbSDaniel Lezcano 6e71e0349SDaniel Lezcano #include <net/inet_frag.h> 7e71e0349SDaniel Lezcano 8b0f159dbSDaniel Lezcano #ifndef __NETNS_IPV6_H__ 9b0f159dbSDaniel Lezcano #define __NETNS_IPV6_H__ 1086393e52SAlexey Dobriyan #include <net/dst_ops.h> 110bc19985SStephen Suryaputra #include <uapi/linux/icmpv6.h> 12b0f159dbSDaniel Lezcano 13760f2d01SDaniel Lezcano struct ctl_table_header; 14760f2d01SDaniel Lezcano 15760f2d01SDaniel Lezcano struct netns_sysctl_ipv6 { 16760f2d01SDaniel Lezcano #ifdef CONFIG_SYSCTL 176dceb036SEric W. Biederman struct ctl_table_header *hdr; 186dceb036SEric W. Biederman struct ctl_table_header *route_hdr; 196dceb036SEric W. Biederman struct ctl_table_header *icmp_hdr; 20e4a2d5c2SPavel Emelyanov struct ctl_table_header *frags_hdr; 218d068875SMichal Kubecek struct ctl_table_header *xfrm6_hdr; 22760f2d01SDaniel Lezcano #endif 234990509fSDaniel Lezcano int flush_delay; 244990509fSDaniel Lezcano int ip6_rt_max_size; 254990509fSDaniel Lezcano int ip6_rt_gc_min_interval; 264990509fSDaniel Lezcano int ip6_rt_gc_timeout; 274990509fSDaniel Lezcano int ip6_rt_gc_interval; 284990509fSDaniel Lezcano int ip6_rt_gc_elasticity; 294990509fSDaniel Lezcano int ip6_rt_mtu_expires; 304990509fSDaniel Lezcano int ip6_rt_min_advmss; 31ed13923fSIdo Schimmel u32 multipath_hash_fields; 32a6175633SEric Dumazet u8 multipath_hash_policy; 33ed13923fSIdo Schimmel u8 bindv6only; 34a6175633SEric Dumazet u8 flowlabel_consistency; 35a6175633SEric Dumazet u8 auto_flowlabels; 3641a76906SDaniel Lezcano int icmpv6_time; 37a6175633SEric Dumazet u8 icmpv6_echo_ignore_all; 38a6175633SEric Dumazet u8 icmpv6_echo_ignore_multicast; 39a6175633SEric Dumazet u8 icmpv6_echo_ignore_anycast; 400bc19985SStephen Suryaputra DECLARE_BITMAP(icmpv6_ratemask, ICMPV6_MSG_MAX + 1); 410bc19985SStephen Suryaputra unsigned long *icmpv6_ratemask_ptr; 42a6175633SEric Dumazet u8 anycast_src_echo_reply; 43a6175633SEric Dumazet u8 ip_nonlocal_bind; 44a6175633SEric Dumazet u8 fwmark_reflect; 45a6175633SEric Dumazet u8 flowlabel_state_ranges; 461855b7c3SHannes Frederic Sowa int idgen_retries; 471855b7c3SHannes Frederic Sowa int idgen_delay; 4822b6722bSJakub Sitnicki int flowlabel_reflect; 4947d3d7acSTom Herbert int max_dst_opts_cnt; 5047d3d7acSTom Herbert int max_hbh_opts_cnt; 5147d3d7acSTom Herbert int max_dst_opts_len; 5247d3d7acSTom Herbert int max_hbh_opts_len; 53b5facfdbSAhmed Abdelsalam int seg6_flowlabel; 549ee11f0fSJustin Iurman u32 ioam6_id; 559ee11f0fSJustin Iurman u64 ioam6_id_wide; 56*ef62c0aeSEric Dumazet u8 skip_notify_on_dev_down; 57a6175633SEric Dumazet u8 fib_notify_on_flag_change; 587ab75456SMahesh Bandewar u8 icmpv6_error_anycast_as_unicast; 59760f2d01SDaniel Lezcano }; 60760f2d01SDaniel Lezcano 61b0f159dbSDaniel Lezcano struct netns_ipv6 { 620dd39d95SEric Dumazet /* Keep ip6_dst_ops at the beginning of netns_sysctl_ipv6 */ 630dd39d95SEric Dumazet struct dst_ops ip6_dst_ops; 640dd39d95SEric Dumazet 65760f2d01SDaniel Lezcano struct netns_sysctl_ipv6 sysctl; 66e0da5a48SPavel Emelyanov struct ipv6_devconf *devconf_all; 67e0da5a48SPavel Emelyanov struct ipv6_devconf *devconf_dflt; 68c8a627edSGao feng struct inet_peer_base *peers; 694907abc6SEric Dumazet struct fqdir *fqdir; 708d1c802bSDavid Ahern struct fib6_info *fib6_null_entry; 718ed67789SDaniel Lezcano struct rt6_info *ip6_null_entry; 72c572872fSBenjamin Thery struct rt6_statistics *rt6_stats; 73417f28bbSStephen Hemminger struct timer_list ip6_fib_timer; 7458f09b78SDaniel Lezcano struct hlist_head *fib_table_hash; 7558f09b78SDaniel Lezcano struct fib6_table *fib6_main_tbl; 769a03cd8fSMichal Kubeček struct list_head fib6_walkers; 779a03cd8fSMichal Kubeček rwlock_t fib6_walker_lock; 783dc94f93SMichal Kubeček spinlock_t fib6_gc_lock; 799cb7c013SEric Dumazet atomic_t ip6_rt_gc_expire; 806891a346SBenjamin Thery unsigned long ip6_rt_last_gc; 810b0dff5bSWillem de Bruijn unsigned char flowlabel_has_excl; 8258f09b78SDaniel Lezcano #ifdef CONFIG_IPV6_MULTIPLE_TABLES 83feca7d8cSVincent Bernat bool fib6_has_custom_rules; 840b0dff5bSWillem de Bruijn unsigned int fib6_rules_require_fldissect; 85b9b33e7cSPaolo Abeni #ifdef CONFIG_IPV6_SUBTREES 86b9b33e7cSPaolo Abeni unsigned int fib6_routes_require_src; 87b9b33e7cSPaolo Abeni #endif 888ed67789SDaniel Lezcano struct rt6_info *ip6_prohibit_entry; 898ed67789SDaniel Lezcano struct rt6_info *ip6_blk_hole_entry; 9058f09b78SDaniel Lezcano struct fib6_table *fib6_local_tbl; 91dcabb819SDaniel Lezcano struct fib_rules_ops *fib6_rules_ops; 9258f09b78SDaniel Lezcano #endif 931762f7e8SDaniel Lezcano struct sock *ndisc_sk; 9493ec926bSDaniel Lezcano struct sock *tcp_sk; 95b8ad0cbcSDaniel Lezcano struct sock *igmp_sk; 9693a714d6SMadhu Challa struct sock *mc_autojoin_sk; 9721a216a8SEric Dumazet 9821a216a8SEric Dumazet struct hlist_head *inet6_addr_lst; 9921a216a8SEric Dumazet spinlock_t addrconf_hash_lock; 1008805d13fSEric Dumazet struct delayed_work addr_chk_work; 10121a216a8SEric Dumazet 102bd91b8bfSBenjamin Thery #ifdef CONFIG_IPV6_MROUTE 103d1db275dSPatrick McHardy #ifndef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES 104b70432f7SYuval Mintz struct mr_table *mrt6; 105d1db275dSPatrick McHardy #else 106d1db275dSPatrick McHardy struct list_head mr6_tables; 107d1db275dSPatrick McHardy struct fib_rules_ops *mr6_rules_ops; 108d1db275dSPatrick McHardy #endif 109bd91b8bfSBenjamin Thery #endif 11063998ac2SNicolas Dichtel atomic_t dev_addr_genid; 111812918c4SHannes Frederic Sowa atomic_t fib6_sernum; 112915d7e5eSDavid Lebrun struct seg6_pernet_data *seg6_data; 11316ab6d7dSIdo Schimmel struct fib_notifier_ops *notifier_ops; 114088aa3eeSYuval Mintz struct fib_notifier_ops *ip6mr_notifier_ops; 115088aa3eeSYuval Mintz unsigned int ipmr_seq; /* protected by rtnl_mutex */ 116a90c9347SEric Dumazet struct { 117a90c9347SEric Dumazet struct hlist_head head; 118a90c9347SEric Dumazet spinlock_t lock; 119a90c9347SEric Dumazet u32 seq; 120a90c9347SEric Dumazet } ip6addrlbl_table; 1219ee11f0fSJustin Iurman struct ioam6_pernet_data *ioam6_data; 122b0f159dbSDaniel Lezcano }; 123c038a767SAmerigo Wang 124c038a767SAmerigo Wang #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) 125c038a767SAmerigo Wang struct netns_nf_frag { 1264907abc6SEric Dumazet struct fqdir *fqdir; 127c038a767SAmerigo Wang }; 128c038a767SAmerigo Wang #endif 129c038a767SAmerigo Wang 130b0f159dbSDaniel Lezcano #endif 131