Alexey Dobriyan | dfdb8d7 | 2008-10-08 11:35:02 +0200 | [diff] [blame] | 1 | #ifndef __NETNS_CONNTRACK_H |
| 2 | #define __NETNS_CONNTRACK_H |
| 3 | |
Alexey Dobriyan | 63c9a26 | 2008-10-08 11:35:04 +0200 | [diff] [blame] | 4 | #include <linux/list.h> |
Eric Dumazet | ea781f1 | 2009-03-25 21:05:46 +0100 | [diff] [blame] | 5 | #include <linux/list_nulls.h> |
Arun Sharma | 60063497 | 2011-07-26 16:09:06 -0700 | [diff] [blame] | 6 | #include <linux/atomic.h> |
Florian Westphal | 9500507 | 2014-06-10 23:12:56 +0200 | [diff] [blame] | 7 | #include <linux/workqueue.h> |
Gao feng | d2ba1fde | 2012-05-28 21:04:12 +0000 | [diff] [blame] | 8 | #include <linux/netfilter/nf_conntrack_tcp.h> |
Davide Caratti | c51d390 | 2016-11-15 15:08:25 +0100 | [diff] [blame^] | 9 | #ifdef CONFIG_NF_CT_PROTO_DCCP |
| 10 | #include <linux/netfilter/nf_conntrack_dccp.h> |
| 11 | #endif |
Jesper Dangaard Brouer | 93bb0ce | 2014-03-03 14:46:13 +0100 | [diff] [blame] | 12 | #include <linux/seqlock.h> |
Alexey Dobriyan | 49ac871 | 2008-10-08 11:35:03 +0200 | [diff] [blame] | 13 | |
Alexey Dobriyan | 8025070 | 2008-10-08 11:35:08 +0200 | [diff] [blame] | 14 | struct ctl_table_header; |
Alexey Dobriyan | 6058fa6 | 2008-10-08 11:35:07 +0200 | [diff] [blame] | 15 | struct nf_conntrack_ecache; |
| 16 | |
Gao feng | 2c352f4 | 2012-05-28 21:04:09 +0000 | [diff] [blame] | 17 | struct nf_proto_net { |
| 18 | #ifdef CONFIG_SYSCTL |
| 19 | struct ctl_table_header *ctl_table_header; |
| 20 | struct ctl_table *ctl_table; |
Gao feng | 2c352f4 | 2012-05-28 21:04:09 +0000 | [diff] [blame] | 21 | #endif |
| 22 | unsigned int users; |
| 23 | }; |
| 24 | |
Gao feng | 15f585b | 2012-05-28 21:04:11 +0000 | [diff] [blame] | 25 | struct nf_generic_net { |
| 26 | struct nf_proto_net pn; |
| 27 | unsigned int timeout; |
| 28 | }; |
| 29 | |
Gao feng | d2ba1fde | 2012-05-28 21:04:12 +0000 | [diff] [blame] | 30 | struct nf_tcp_net { |
| 31 | struct nf_proto_net pn; |
| 32 | unsigned int timeouts[TCP_CONNTRACK_TIMEOUT_MAX]; |
| 33 | unsigned int tcp_loose; |
| 34 | unsigned int tcp_be_liberal; |
| 35 | unsigned int tcp_max_retrans; |
| 36 | }; |
| 37 | |
Gao feng | 0ce490a | 2012-05-28 21:04:13 +0000 | [diff] [blame] | 38 | enum udp_conntrack { |
| 39 | UDP_CT_UNREPLIED, |
| 40 | UDP_CT_REPLIED, |
| 41 | UDP_CT_MAX |
| 42 | }; |
| 43 | |
| 44 | struct nf_udp_net { |
| 45 | struct nf_proto_net pn; |
| 46 | unsigned int timeouts[UDP_CT_MAX]; |
| 47 | }; |
| 48 | |
Gao feng | 4b626b9 | 2012-05-28 21:04:14 +0000 | [diff] [blame] | 49 | struct nf_icmp_net { |
| 50 | struct nf_proto_net pn; |
| 51 | unsigned int timeout; |
| 52 | }; |
| 53 | |
Davide Caratti | c51d390 | 2016-11-15 15:08:25 +0100 | [diff] [blame^] | 54 | #ifdef CONFIG_NF_CT_PROTO_DCCP |
| 55 | struct nf_dccp_net { |
| 56 | struct nf_proto_net pn; |
| 57 | int dccp_loose; |
| 58 | unsigned int dccp_timeout[CT_DCCP_MAX + 1]; |
| 59 | }; |
| 60 | #endif |
| 61 | |
Gao feng | 524a53e | 2012-05-28 21:04:10 +0000 | [diff] [blame] | 62 | struct nf_ip_net { |
Gao feng | 15f585b | 2012-05-28 21:04:11 +0000 | [diff] [blame] | 63 | struct nf_generic_net generic; |
Gao feng | d2ba1fde | 2012-05-28 21:04:12 +0000 | [diff] [blame] | 64 | struct nf_tcp_net tcp; |
Gao feng | 0ce490a | 2012-05-28 21:04:13 +0000 | [diff] [blame] | 65 | struct nf_udp_net udp; |
Gao feng | 4b626b9 | 2012-05-28 21:04:14 +0000 | [diff] [blame] | 66 | struct nf_icmp_net icmp; |
Gao feng | 7080ba0 | 2012-05-28 21:04:15 +0000 | [diff] [blame] | 67 | struct nf_icmp_net icmpv6; |
Davide Caratti | c51d390 | 2016-11-15 15:08:25 +0100 | [diff] [blame^] | 68 | #ifdef CONFIG_NF_CT_PROTO_DCCP |
| 69 | struct nf_dccp_net dccp; |
| 70 | #endif |
Gao feng | 524a53e | 2012-05-28 21:04:10 +0000 | [diff] [blame] | 71 | }; |
| 72 | |
Jesper Dangaard Brouer | b7779d0 | 2014-03-03 14:45:20 +0100 | [diff] [blame] | 73 | struct ct_pcpu { |
| 74 | spinlock_t lock; |
| 75 | struct hlist_nulls_head unconfirmed; |
| 76 | struct hlist_nulls_head dying; |
Jesper Dangaard Brouer | b7779d0 | 2014-03-03 14:45:20 +0100 | [diff] [blame] | 77 | }; |
| 78 | |
Alexey Dobriyan | dfdb8d7 | 2008-10-08 11:35:02 +0200 | [diff] [blame] | 79 | struct netns_ct { |
Alexey Dobriyan | 49ac871 | 2008-10-08 11:35:03 +0200 | [diff] [blame] | 80 | atomic_t count; |
Alexey Dobriyan | 9b03f38 | 2008-10-08 11:35:03 +0200 | [diff] [blame] | 81 | unsigned int expect_count; |
Florian Westphal | 9500507 | 2014-06-10 23:12:56 +0200 | [diff] [blame] | 82 | #ifdef CONFIG_NF_CONNTRACK_EVENTS |
| 83 | struct delayed_work ecache_dwork; |
| 84 | bool ecache_dwork_pending; |
| 85 | #endif |
Jesper Dangaard Brouer | 8cf4d6a | 2013-11-15 15:57:53 +0100 | [diff] [blame] | 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 |
Jesper Dangaard Brouer | 8cf4d6a | 2013-11-15 15:57:53 +0100 | [diff] [blame] | 93 | unsigned int sysctl_log_invalid; /* Log invalid packets */ |
Jesper Dangaard Brouer | 8cf4d6a | 2013-11-15 15:57:53 +0100 | [diff] [blame] | 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 | |
Jesper Dangaard Brouer | b7779d0 | 2014-03-03 14:45:20 +0100 | [diff] [blame] | 101 | struct ct_pcpu __percpu *pcpu_lists; |
Tejun Heo | 7d720c3 | 2010-02-16 15:20:26 +0000 | [diff] [blame] | 102 | struct ip_conntrack_stat __percpu *stat; |
Pablo Neira Ayuso | 70e9942 | 2011-11-22 00:16:51 +0100 | [diff] [blame] | 103 | struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb; |
| 104 | struct nf_exp_event_notifier __rcu *nf_expect_event_cb; |
Gao feng | 524a53e | 2012-05-28 21:04:10 +0000 | [diff] [blame] | 105 | struct nf_ip_net nf_ct_proto; |
Florian Westphal | c539f01 | 2013-01-11 06:30:44 +0000 | [diff] [blame] | 106 | #if defined(CONFIG_NF_CONNTRACK_LABELS) |
| 107 | unsigned int labels_used; |
Florian Westphal | c539f01 | 2013-01-11 06:30:44 +0000 | [diff] [blame] | 108 | #endif |
Alexey Dobriyan | dfdb8d7 | 2008-10-08 11:35:02 +0200 | [diff] [blame] | 109 | }; |
| 110 | #endif |