ipv4.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * ipv4 in net namespaces
  4. */
  5. #ifndef __NETNS_IPV4_H__
  6. #define __NETNS_IPV4_H__
  7. #include <linux/uidgid.h>
  8. #include <net/inet_frag.h>
  9. #include <linux/rcupdate.h>
  10. #include <linux/siphash.h>
  11. struct tcpm_hash_bucket;
  12. struct ctl_table_header;
  13. struct ipv4_devconf;
  14. struct fib_rules_ops;
  15. struct hlist_head;
  16. struct fib_table;
  17. struct sock;
  18. struct local_ports {
  19. seqlock_t lock;
  20. int range[2];
  21. bool warned;
  22. };
  23. struct ping_group_range {
  24. seqlock_t lock;
  25. kgid_t range[2];
  26. };
  27. struct inet_hashinfo;
  28. struct inet_timewait_death_row {
  29. atomic_t tw_count;
  30. struct inet_hashinfo *hashinfo ____cacheline_aligned_in_smp;
  31. int sysctl_max_tw_buckets;
  32. };
  33. struct tcp_fastopen_context;
  34. struct netns_ipv4 {
  35. #ifdef CONFIG_SYSCTL
  36. struct ctl_table_header *forw_hdr;
  37. struct ctl_table_header *frags_hdr;
  38. struct ctl_table_header *ipv4_hdr;
  39. struct ctl_table_header *route_hdr;
  40. struct ctl_table_header *xfrm4_hdr;
  41. #endif
  42. struct ipv4_devconf *devconf_all;
  43. struct ipv4_devconf *devconf_dflt;
  44. struct ip_ra_chain __rcu *ra_chain;
  45. struct mutex ra_mutex;
  46. #ifdef CONFIG_IP_MULTIPLE_TABLES
  47. struct fib_rules_ops *rules_ops;
  48. bool fib_has_custom_rules;
  49. unsigned int fib_rules_require_fldissect;
  50. struct fib_table __rcu *fib_main;
  51. struct fib_table __rcu *fib_default;
  52. #endif
  53. bool fib_has_custom_local_routes;
  54. #ifdef CONFIG_IP_ROUTE_CLASSID
  55. int fib_num_tclassid_users;
  56. #endif
  57. struct hlist_head *fib_table_hash;
  58. bool fib_offload_disabled;
  59. struct sock *fibnl;
  60. struct sock * __percpu *icmp_sk;
  61. struct sock *mc_autojoin_sk;
  62. struct inet_peer_base *peers;
  63. struct sock * __percpu *tcp_sk;
  64. struct netns_frags frags;
  65. #ifdef CONFIG_NETFILTER
  66. struct xt_table *iptable_filter;
  67. struct xt_table *iptable_mangle;
  68. struct xt_table *iptable_raw;
  69. struct xt_table *arptable_filter;
  70. #ifdef CONFIG_SECURITY
  71. struct xt_table *iptable_security;
  72. #endif
  73. struct xt_table *nat_table;
  74. #endif
  75. int sysctl_icmp_echo_ignore_all;
  76. int sysctl_icmp_echo_ignore_broadcasts;
  77. int sysctl_icmp_ignore_bogus_error_responses;
  78. int sysctl_icmp_ratelimit;
  79. int sysctl_icmp_ratemask;
  80. int sysctl_icmp_errors_use_inbound_ifaddr;
  81. struct local_ports ip_local_ports;
  82. int sysctl_tcp_ecn;
  83. int sysctl_tcp_ecn_fallback;
  84. int sysctl_ip_default_ttl;
  85. int sysctl_ip_no_pmtu_disc;
  86. int sysctl_ip_fwd_use_pmtu;
  87. int sysctl_ip_fwd_update_priority;
  88. int sysctl_ip_nonlocal_bind;
  89. /* Shall we try to damage output packets if routing dev changes? */
  90. int sysctl_ip_dynaddr;
  91. int sysctl_ip_early_demux;
  92. int sysctl_tcp_early_demux;
  93. int sysctl_udp_early_demux;
  94. int sysctl_fwmark_reflect;
  95. int sysctl_tcp_fwmark_accept;
  96. #ifdef CONFIG_NET_L3_MASTER_DEV
  97. int sysctl_tcp_l3mdev_accept;
  98. #endif
  99. int sysctl_tcp_mtu_probing;
  100. int sysctl_tcp_base_mss;
  101. int sysctl_tcp_min_snd_mss;
  102. int sysctl_tcp_probe_threshold;
  103. u32 sysctl_tcp_probe_interval;
  104. int sysctl_tcp_keepalive_time;
  105. int sysctl_tcp_keepalive_probes;
  106. int sysctl_tcp_keepalive_intvl;
  107. int sysctl_tcp_syn_retries;
  108. int sysctl_tcp_synack_retries;
  109. int sysctl_tcp_syncookies;
  110. int sysctl_tcp_reordering;
  111. int sysctl_tcp_retries1;
  112. int sysctl_tcp_retries2;
  113. int sysctl_tcp_orphan_retries;
  114. int sysctl_tcp_fin_timeout;
  115. unsigned int sysctl_tcp_notsent_lowat;
  116. int sysctl_tcp_tw_reuse;
  117. int sysctl_tcp_sack;
  118. int sysctl_tcp_window_scaling;
  119. int sysctl_tcp_timestamps;
  120. int sysctl_tcp_early_retrans;
  121. int sysctl_tcp_recovery;
  122. int sysctl_tcp_thin_linear_timeouts;
  123. int sysctl_tcp_slow_start_after_idle;
  124. int sysctl_tcp_retrans_collapse;
  125. int sysctl_tcp_stdurg;
  126. int sysctl_tcp_rfc1337;
  127. int sysctl_tcp_abort_on_overflow;
  128. int sysctl_tcp_fack;
  129. int sysctl_tcp_max_reordering;
  130. int sysctl_tcp_dsack;
  131. int sysctl_tcp_app_win;
  132. int sysctl_tcp_adv_win_scale;
  133. int sysctl_tcp_frto;
  134. int sysctl_tcp_nometrics_save;
  135. int sysctl_tcp_moderate_rcvbuf;
  136. int sysctl_tcp_tso_win_divisor;
  137. int sysctl_tcp_workaround_signed_windows;
  138. int sysctl_tcp_limit_output_bytes;
  139. int sysctl_tcp_challenge_ack_limit;
  140. int sysctl_tcp_min_tso_segs;
  141. int sysctl_tcp_min_rtt_wlen;
  142. int sysctl_tcp_autocorking;
  143. int sysctl_tcp_invalid_ratelimit;
  144. int sysctl_tcp_pacing_ss_ratio;
  145. int sysctl_tcp_pacing_ca_ratio;
  146. int sysctl_tcp_wmem[3];
  147. int sysctl_tcp_rmem[3];
  148. int sysctl_tcp_comp_sack_nr;
  149. unsigned long sysctl_tcp_comp_sack_delay_ns;
  150. struct inet_timewait_death_row tcp_death_row;
  151. int sysctl_max_syn_backlog;
  152. int sysctl_tcp_fastopen;
  153. const struct tcp_congestion_ops __rcu *tcp_congestion_control;
  154. struct tcp_fastopen_context __rcu *tcp_fastopen_ctx;
  155. spinlock_t tcp_fastopen_ctx_lock;
  156. unsigned int sysctl_tcp_fastopen_blackhole_timeout;
  157. atomic_t tfo_active_disable_times;
  158. unsigned long tfo_active_disable_stamp;
  159. int sysctl_udp_wmem_min;
  160. int sysctl_udp_rmem_min;
  161. #ifdef CONFIG_NET_L3_MASTER_DEV
  162. int sysctl_udp_l3mdev_accept;
  163. #endif
  164. int sysctl_igmp_max_memberships;
  165. int sysctl_igmp_max_msf;
  166. int sysctl_igmp_llm_reports;
  167. int sysctl_igmp_qrv;
  168. struct ping_group_range ping_group_range;
  169. atomic_t dev_addr_genid;
  170. #ifdef CONFIG_SYSCTL
  171. unsigned long *sysctl_local_reserved_ports;
  172. int sysctl_ip_prot_sock;
  173. #endif
  174. #ifdef CONFIG_IP_MROUTE
  175. #ifndef CONFIG_IP_MROUTE_MULTIPLE_TABLES
  176. struct mr_table *mrt;
  177. #else
  178. struct list_head mr_tables;
  179. struct fib_rules_ops *mr_rules_ops;
  180. #endif
  181. #endif
  182. #ifdef CONFIG_IP_ROUTE_MULTIPATH
  183. int sysctl_fib_multipath_use_neigh;
  184. int sysctl_fib_multipath_hash_policy;
  185. #endif
  186. struct fib_notifier_ops *notifier_ops;
  187. unsigned int fib_seq; /* protected by rtnl_mutex */
  188. struct fib_notifier_ops *ipmr_notifier_ops;
  189. unsigned int ipmr_seq; /* protected by rtnl_mutex */
  190. atomic_t rt_genid;
  191. siphash_key_t ip_id_key;
  192. };
  193. #endif