conntrack.h 2.7 KB

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