conntrack.h 2.6 KB

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