ipv6.h 3.3 KB

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