ipv6.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. __cacheline_group_begin(sysctl_ipv6_flowlabel);
  30. u8 flowlabel_consistency;
  31. u8 auto_flowlabels;
  32. u8 flowlabel_state_ranges;
  33. __cacheline_group_end(sysctl_ipv6_flowlabel);
  34. u8 icmpv6_echo_ignore_all;
  35. u8 icmpv6_echo_ignore_multicast;
  36. u8 icmpv6_echo_ignore_anycast;
  37. int icmpv6_time;
  38. DECLARE_BITMAP(icmpv6_ratemask, ICMPV6_MSG_MAX + 1);
  39. unsigned long *icmpv6_ratemask_ptr;
  40. u8 anycast_src_echo_reply;
  41. u8 bindv6only;
  42. u8 ip_nonlocal_bind;
  43. u8 fwmark_reflect;
  44. int idgen_retries;
  45. int idgen_delay;
  46. int flowlabel_reflect;
  47. int max_dst_opts_cnt;
  48. int max_hbh_opts_cnt;
  49. int max_dst_opts_len;
  50. int max_hbh_opts_len;
  51. int seg6_flowlabel;
  52. u32 ioam6_id;
  53. u64 ioam6_id_wide;
  54. u8 skip_notify_on_dev_down;
  55. u8 fib_notify_on_flag_change;
  56. u8 icmpv6_error_anycast_as_unicast;
  57. u8 icmpv6_errors_extension_mask;
  58. };
  59. struct netns_ipv6 {
  60. /* Keep ip6_dst_ops at the beginning of netns_sysctl_ipv6 */
  61. struct dst_ops ip6_dst_ops;
  62. struct netns_sysctl_ipv6 sysctl;
  63. struct ipv6_devconf *devconf_all;
  64. struct ipv6_devconf *devconf_dflt;
  65. struct inet_peer_base *peers;
  66. struct fqdir *fqdir;
  67. struct fib6_info *fib6_null_entry;
  68. struct rt6_info *ip6_null_entry;
  69. struct rt6_statistics *rt6_stats;
  70. struct timer_list ip6_fib_timer;
  71. struct hlist_head *fib_table_hash;
  72. spinlock_t fib_table_hash_lock;
  73. struct fib6_table *fib6_main_tbl;
  74. struct list_head fib6_walkers;
  75. rwlock_t fib6_walker_lock;
  76. spinlock_t fib6_gc_lock;
  77. atomic_t ip6_rt_gc_expire;
  78. unsigned long ip6_rt_last_gc;
  79. unsigned char flowlabel_has_excl;
  80. #ifdef CONFIG_IPV6_MULTIPLE_TABLES
  81. bool fib6_has_custom_rules;
  82. unsigned int fib6_rules_require_fldissect;
  83. #ifdef CONFIG_IPV6_SUBTREES
  84. unsigned int fib6_routes_require_src;
  85. #endif
  86. struct rt6_info *ip6_prohibit_entry;
  87. struct rt6_info *ip6_blk_hole_entry;
  88. struct fib6_table *fib6_local_tbl;
  89. struct fib_rules_ops *fib6_rules_ops;
  90. #endif
  91. struct sock *ndisc_sk;
  92. struct sock *tcp_sk;
  93. struct sock *igmp_sk;
  94. struct sock *mc_autojoin_sk;
  95. struct hlist_head *inet6_addr_lst;
  96. spinlock_t addrconf_hash_lock;
  97. struct delayed_work addr_chk_work;
  98. #ifdef CONFIG_IPV6_MROUTE
  99. #ifndef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES
  100. struct mr_table *mrt6;
  101. #else
  102. struct list_head mr6_tables;
  103. struct fib_rules_ops *mr6_rules_ops;
  104. #endif
  105. #endif
  106. atomic_t dev_addr_genid;
  107. atomic_t fib6_sernum;
  108. struct seg6_pernet_data *seg6_data;
  109. struct fib_notifier_ops *notifier_ops;
  110. struct fib_notifier_ops *ip6mr_notifier_ops;
  111. unsigned int ipmr_seq; /* protected by rtnl_mutex */
  112. struct {
  113. struct hlist_head head;
  114. spinlock_t lock;
  115. u32 seq;
  116. } ip6addrlbl_table;
  117. struct ioam6_pernet_data *ioam6_data;
  118. };
  119. #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
  120. struct netns_nf_frag {
  121. struct fqdir *fqdir;
  122. };
  123. #endif
  124. #endif