conntrack.h 2.7 KB

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