conntrack.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. #endif
  16. unsigned int users;
  17. };
  18. struct nf_generic_net {
  19. struct nf_proto_net pn;
  20. unsigned int timeout;
  21. };
  22. struct nf_tcp_net {
  23. struct nf_proto_net pn;
  24. unsigned int timeouts[TCP_CONNTRACK_TIMEOUT_MAX];
  25. unsigned int tcp_loose;
  26. unsigned int tcp_be_liberal;
  27. unsigned int tcp_max_retrans;
  28. };
  29. enum udp_conntrack {
  30. UDP_CT_UNREPLIED,
  31. UDP_CT_REPLIED,
  32. UDP_CT_MAX
  33. };
  34. struct nf_udp_net {
  35. struct nf_proto_net pn;
  36. unsigned int timeouts[UDP_CT_MAX];
  37. };
  38. struct nf_icmp_net {
  39. struct nf_proto_net pn;
  40. unsigned int timeout;
  41. };
  42. struct nf_ip_net {
  43. struct nf_generic_net generic;
  44. struct nf_tcp_net tcp;
  45. struct nf_udp_net udp;
  46. struct nf_icmp_net icmp;
  47. struct nf_icmp_net icmpv6;
  48. };
  49. struct ct_pcpu {
  50. spinlock_t lock;
  51. struct hlist_nulls_head unconfirmed;
  52. struct hlist_nulls_head dying;
  53. };
  54. struct netns_ct {
  55. atomic_t count;
  56. unsigned int expect_count;
  57. #ifdef CONFIG_NF_CONNTRACK_EVENTS
  58. struct delayed_work ecache_dwork;
  59. bool ecache_dwork_pending;
  60. #endif
  61. #ifdef CONFIG_SYSCTL
  62. struct ctl_table_header *sysctl_header;
  63. struct ctl_table_header *acct_sysctl_header;
  64. struct ctl_table_header *tstamp_sysctl_header;
  65. struct ctl_table_header *event_sysctl_header;
  66. struct ctl_table_header *helper_sysctl_header;
  67. #endif
  68. unsigned int sysctl_log_invalid; /* Log invalid packets */
  69. int sysctl_events;
  70. int sysctl_acct;
  71. int sysctl_auto_assign_helper;
  72. bool auto_assign_helper_warned;
  73. int sysctl_tstamp;
  74. int sysctl_checksum;
  75. struct ct_pcpu __percpu *pcpu_lists;
  76. struct ip_conntrack_stat __percpu *stat;
  77. struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb;
  78. struct nf_exp_event_notifier __rcu *nf_expect_event_cb;
  79. struct nf_ip_net nf_ct_proto;
  80. #if defined(CONFIG_NF_CONNTRACK_LABELS)
  81. unsigned int labels_used;
  82. u8 label_words;
  83. #endif
  84. };
  85. #endif