ipv4.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /*
  2. * ipv4 in net namespaces
  3. */
  4. #ifndef __NETNS_IPV4_H__
  5. #define __NETNS_IPV4_H__
  6. #include <linux/uidgid.h>
  7. #include <net/inet_frag.h>
  8. #include <linux/rcupdate.h>
  9. struct tcpm_hash_bucket;
  10. struct ctl_table_header;
  11. struct ipv4_devconf;
  12. struct fib_rules_ops;
  13. struct hlist_head;
  14. struct fib_table;
  15. struct sock;
  16. struct local_ports {
  17. seqlock_t lock;
  18. int range[2];
  19. bool warned;
  20. };
  21. struct ping_group_range {
  22. seqlock_t lock;
  23. kgid_t range[2];
  24. };
  25. struct inet_hashinfo;
  26. struct inet_timewait_death_row {
  27. atomic_t tw_count;
  28. struct inet_hashinfo *hashinfo ____cacheline_aligned_in_smp;
  29. int sysctl_tw_recycle;
  30. int sysctl_max_tw_buckets;
  31. };
  32. struct netns_ipv4 {
  33. #ifdef CONFIG_SYSCTL
  34. struct ctl_table_header *forw_hdr;
  35. struct ctl_table_header *frags_hdr;
  36. struct ctl_table_header *ipv4_hdr;
  37. struct ctl_table_header *route_hdr;
  38. struct ctl_table_header *xfrm4_hdr;
  39. #endif
  40. struct ipv4_devconf *devconf_all;
  41. struct ipv4_devconf *devconf_dflt;
  42. #ifdef CONFIG_IP_MULTIPLE_TABLES
  43. struct fib_rules_ops *rules_ops;
  44. bool fib_has_custom_rules;
  45. struct fib_table __rcu *fib_main;
  46. struct fib_table __rcu *fib_default;
  47. #endif
  48. #ifdef CONFIG_IP_ROUTE_CLASSID
  49. int fib_num_tclassid_users;
  50. #endif
  51. struct hlist_head *fib_table_hash;
  52. bool fib_offload_disabled;
  53. struct sock *fibnl;
  54. struct sock * __percpu *icmp_sk;
  55. struct sock *mc_autojoin_sk;
  56. struct inet_peer_base *peers;
  57. struct sock * __percpu *tcp_sk;
  58. struct netns_frags frags;
  59. #ifdef CONFIG_NETFILTER
  60. struct xt_table *iptable_filter;
  61. struct xt_table *iptable_mangle;
  62. struct xt_table *iptable_raw;
  63. struct xt_table *arptable_filter;
  64. #ifdef CONFIG_SECURITY
  65. struct xt_table *iptable_security;
  66. #endif
  67. struct xt_table *nat_table;
  68. #endif
  69. int sysctl_icmp_echo_ignore_all;
  70. int sysctl_icmp_echo_ignore_broadcasts;
  71. int sysctl_icmp_ignore_bogus_error_responses;
  72. int sysctl_icmp_ratelimit;
  73. int sysctl_icmp_ratemask;
  74. int sysctl_icmp_errors_use_inbound_ifaddr;
  75. struct local_ports ip_local_ports;
  76. int sysctl_tcp_ecn;
  77. int sysctl_tcp_ecn_fallback;
  78. int sysctl_ip_default_ttl;
  79. int sysctl_ip_no_pmtu_disc;
  80. int sysctl_ip_fwd_use_pmtu;
  81. int sysctl_ip_nonlocal_bind;
  82. /* Shall we try to damage output packets if routing dev changes? */
  83. int sysctl_ip_dynaddr;
  84. int sysctl_ip_early_demux;
  85. int sysctl_fwmark_reflect;
  86. int sysctl_tcp_fwmark_accept;
  87. #ifdef CONFIG_NET_L3_MASTER_DEV
  88. int sysctl_tcp_l3mdev_accept;
  89. #endif
  90. int sysctl_tcp_mtu_probing;
  91. int sysctl_tcp_base_mss;
  92. int sysctl_tcp_probe_threshold;
  93. u32 sysctl_tcp_probe_interval;
  94. int sysctl_tcp_keepalive_time;
  95. int sysctl_tcp_keepalive_probes;
  96. int sysctl_tcp_keepalive_intvl;
  97. int sysctl_tcp_syn_retries;
  98. int sysctl_tcp_synack_retries;
  99. int sysctl_tcp_syncookies;
  100. int sysctl_tcp_reordering;
  101. int sysctl_tcp_retries1;
  102. int sysctl_tcp_retries2;
  103. int sysctl_tcp_orphan_retries;
  104. int sysctl_tcp_fin_timeout;
  105. unsigned int sysctl_tcp_notsent_lowat;
  106. int sysctl_tcp_tw_reuse;
  107. struct inet_timewait_death_row tcp_death_row;
  108. int sysctl_max_syn_backlog;
  109. int sysctl_igmp_max_memberships;
  110. int sysctl_igmp_max_msf;
  111. int sysctl_igmp_llm_reports;
  112. int sysctl_igmp_qrv;
  113. struct ping_group_range ping_group_range;
  114. atomic_t dev_addr_genid;
  115. #ifdef CONFIG_SYSCTL
  116. unsigned long *sysctl_local_reserved_ports;
  117. #endif
  118. #ifdef CONFIG_IP_MROUTE
  119. #ifndef CONFIG_IP_MROUTE_MULTIPLE_TABLES
  120. struct mr_table *mrt;
  121. #else
  122. struct list_head mr_tables;
  123. struct fib_rules_ops *mr_rules_ops;
  124. #endif
  125. #endif
  126. #ifdef CONFIG_IP_ROUTE_MULTIPATH
  127. int sysctl_fib_multipath_use_neigh;
  128. #endif
  129. unsigned int fib_seq; /* protected by rtnl_mutex */
  130. atomic_t rt_genid;
  131. };
  132. #endif