conntrack.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #ifndef __NETNS_CONNTRACK_H
  2. #define __NETNS_CONNTRACK_H
  3. #include <linux/list.h>
  4. #include <linux/list_nulls.h>
  5. #include <linux/atomic.h>
  6. #include <linux/netfilter/nf_conntrack_tcp.h>
  7. struct ctl_table_header;
  8. struct nf_conntrack_ecache;
  9. struct nf_proto_net {
  10. #ifdef CONFIG_SYSCTL
  11. struct ctl_table_header *ctl_table_header;
  12. struct ctl_table *ctl_table;
  13. #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
  14. struct ctl_table_header *ctl_compat_header;
  15. struct ctl_table *ctl_compat_table;
  16. #endif
  17. #endif
  18. unsigned int users;
  19. };
  20. struct nf_generic_net {
  21. struct nf_proto_net pn;
  22. unsigned int timeout;
  23. };
  24. struct nf_tcp_net {
  25. struct nf_proto_net pn;
  26. unsigned int timeouts[TCP_CONNTRACK_TIMEOUT_MAX];
  27. unsigned int tcp_loose;
  28. unsigned int tcp_be_liberal;
  29. unsigned int tcp_max_retrans;
  30. };
  31. enum udp_conntrack {
  32. UDP_CT_UNREPLIED,
  33. UDP_CT_REPLIED,
  34. UDP_CT_MAX
  35. };
  36. struct nf_udp_net {
  37. struct nf_proto_net pn;
  38. unsigned int timeouts[UDP_CT_MAX];
  39. };
  40. struct nf_icmp_net {
  41. struct nf_proto_net pn;
  42. unsigned int timeout;
  43. };
  44. struct nf_ip_net {
  45. struct nf_generic_net generic;
  46. struct nf_tcp_net tcp;
  47. struct nf_udp_net udp;
  48. struct nf_icmp_net icmp;
  49. struct nf_icmp_net icmpv6;
  50. #if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT)
  51. struct ctl_table_header *ctl_table_header;
  52. struct ctl_table *ctl_table;
  53. #endif
  54. };
  55. struct netns_ct {
  56. atomic_t count;
  57. unsigned int expect_count;
  58. unsigned int htable_size;
  59. struct kmem_cache *nf_conntrack_cachep;
  60. struct hlist_nulls_head *hash;
  61. struct hlist_head *expect_hash;
  62. struct hlist_nulls_head unconfirmed;
  63. struct hlist_nulls_head dying;
  64. struct hlist_nulls_head tmpl;
  65. struct ip_conntrack_stat __percpu *stat;
  66. struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb;
  67. struct nf_exp_event_notifier __rcu *nf_expect_event_cb;
  68. int sysctl_events;
  69. unsigned int sysctl_events_retry_timeout;
  70. int sysctl_acct;
  71. int sysctl_tstamp;
  72. int sysctl_checksum;
  73. unsigned int sysctl_log_invalid; /* Log invalid packets */
  74. int sysctl_auto_assign_helper;
  75. bool auto_assign_helper_warned;
  76. struct nf_ip_net nf_ct_proto;
  77. #if defined(CONFIG_NF_CONNTRACK_LABELS)
  78. unsigned int labels_used;
  79. u8 label_words;
  80. #endif
  81. #ifdef CONFIG_NF_NAT_NEEDED
  82. struct hlist_head *nat_bysource;
  83. unsigned int nat_htable_size;
  84. #endif
  85. #ifdef CONFIG_SYSCTL
  86. struct ctl_table_header *sysctl_header;
  87. struct ctl_table_header *acct_sysctl_header;
  88. struct ctl_table_header *tstamp_sysctl_header;
  89. struct ctl_table_header *event_sysctl_header;
  90. struct ctl_table_header *helper_sysctl_header;
  91. #endif
  92. char *slabname;
  93. };
  94. #endif