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> |
Gao feng | d2ba1fd | 2012-05-28 21:04:12 +0000 | [diff] [blame] | 7 | #include <linux/netfilter/nf_conntrack_tcp.h> |
Alexey Dobriyan | 49ac871 | 2008-10-08 11:35:03 +0200 | [diff] [blame] | 8 | |
Alexey Dobriyan | 8025070 | 2008-10-08 11:35:08 +0200 | [diff] [blame] | 9 | struct ctl_table_header; |
Alexey Dobriyan | 6058fa6 | 2008-10-08 11:35:07 +0200 | [diff] [blame] | 10 | struct nf_conntrack_ecache; |
| 11 | |
Gao feng | 2c352f4 | 2012-05-28 21:04:09 +0000 | [diff] [blame] | 12 | struct nf_proto_net { |
| 13 | #ifdef CONFIG_SYSCTL |
| 14 | struct ctl_table_header *ctl_table_header; |
| 15 | struct ctl_table *ctl_table; |
| 16 | #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT |
| 17 | struct ctl_table_header *ctl_compat_header; |
| 18 | struct ctl_table *ctl_compat_table; |
| 19 | #endif |
| 20 | #endif |
| 21 | unsigned int users; |
| 22 | }; |
| 23 | |
Gao feng | 15f585b | 2012-05-28 21:04:11 +0000 | [diff] [blame] | 24 | struct nf_generic_net { |
| 25 | struct nf_proto_net pn; |
| 26 | unsigned int timeout; |
| 27 | }; |
| 28 | |
Gao feng | d2ba1fd | 2012-05-28 21:04:12 +0000 | [diff] [blame] | 29 | struct nf_tcp_net { |
| 30 | struct nf_proto_net pn; |
| 31 | unsigned int timeouts[TCP_CONNTRACK_TIMEOUT_MAX]; |
| 32 | unsigned int tcp_loose; |
| 33 | unsigned int tcp_be_liberal; |
| 34 | unsigned int tcp_max_retrans; |
| 35 | }; |
| 36 | |
Gao feng | 0ce490a | 2012-05-28 21:04:13 +0000 | [diff] [blame] | 37 | enum udp_conntrack { |
| 38 | UDP_CT_UNREPLIED, |
| 39 | UDP_CT_REPLIED, |
| 40 | UDP_CT_MAX |
| 41 | }; |
| 42 | |
| 43 | struct nf_udp_net { |
| 44 | struct nf_proto_net pn; |
| 45 | unsigned int timeouts[UDP_CT_MAX]; |
| 46 | }; |
| 47 | |
Gao feng | 4b626b9 | 2012-05-28 21:04:14 +0000 | [diff] [blame] | 48 | struct nf_icmp_net { |
| 49 | struct nf_proto_net pn; |
| 50 | unsigned int timeout; |
| 51 | }; |
| 52 | |
Gao feng | 524a53e | 2012-05-28 21:04:10 +0000 | [diff] [blame] | 53 | struct nf_ip_net { |
Gao feng | 15f585b | 2012-05-28 21:04:11 +0000 | [diff] [blame] | 54 | struct nf_generic_net generic; |
Gao feng | d2ba1fd | 2012-05-28 21:04:12 +0000 | [diff] [blame] | 55 | struct nf_tcp_net tcp; |
Gao feng | 0ce490a | 2012-05-28 21:04:13 +0000 | [diff] [blame] | 56 | struct nf_udp_net udp; |
Gao feng | 4b626b9 | 2012-05-28 21:04:14 +0000 | [diff] [blame] | 57 | struct nf_icmp_net icmp; |
Gao feng | 7080ba0 | 2012-05-28 21:04:15 +0000 | [diff] [blame] | 58 | struct nf_icmp_net icmpv6; |
Gao feng | 524a53e | 2012-05-28 21:04:10 +0000 | [diff] [blame] | 59 | #if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT) |
| 60 | struct ctl_table_header *ctl_table_header; |
| 61 | struct ctl_table *ctl_table; |
| 62 | #endif |
| 63 | }; |
| 64 | |
Alexey Dobriyan | dfdb8d7 | 2008-10-08 11:35:02 +0200 | [diff] [blame] | 65 | struct netns_ct { |
Alexey Dobriyan | 49ac871 | 2008-10-08 11:35:03 +0200 | [diff] [blame] | 66 | atomic_t count; |
Alexey Dobriyan | 9b03f38 | 2008-10-08 11:35:03 +0200 | [diff] [blame] | 67 | unsigned int expect_count; |
Patrick McHardy | d696c7b | 2010-02-08 11:18:07 -0800 | [diff] [blame] | 68 | unsigned int htable_size; |
Eric Dumazet | 5b3501f | 2010-02-08 11:16:56 -0800 | [diff] [blame] | 69 | struct kmem_cache *nf_conntrack_cachep; |
Eric Dumazet | ea781f1 | 2009-03-25 21:05:46 +0100 | [diff] [blame] | 70 | struct hlist_nulls_head *hash; |
Alexey Dobriyan | 9b03f38 | 2008-10-08 11:35:03 +0200 | [diff] [blame] | 71 | struct hlist_head *expect_hash; |
Eric Dumazet | ea781f1 | 2009-03-25 21:05:46 +0100 | [diff] [blame] | 72 | struct hlist_nulls_head unconfirmed; |
Pablo Neira Ayuso | dd7669a | 2009-06-13 12:30:52 +0200 | [diff] [blame] | 73 | struct hlist_nulls_head dying; |
Tejun Heo | 7d720c3 | 2010-02-16 15:20:26 +0000 | [diff] [blame] | 74 | struct ip_conntrack_stat __percpu *stat; |
Pablo Neira Ayuso | 70e9942 | 2011-11-22 00:16:51 +0100 | [diff] [blame] | 75 | struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb; |
| 76 | struct nf_exp_event_notifier __rcu *nf_expect_event_cb; |
Pablo Neira Ayuso | a0891aa | 2009-06-13 12:26:29 +0200 | [diff] [blame] | 77 | int sysctl_events; |
Pablo Neira Ayuso | dd7669a | 2009-06-13 12:30:52 +0200 | [diff] [blame] | 78 | unsigned int sysctl_events_retry_timeout; |
Alexey Dobriyan | d716a4d | 2008-10-08 11:35:09 +0200 | [diff] [blame] | 79 | int sysctl_acct; |
Pablo Neira Ayuso | a992ca2 | 2011-01-19 16:00:07 +0100 | [diff] [blame] | 80 | int sysctl_tstamp; |
Alexey Dobriyan | c04d055 | 2008-10-08 11:35:08 +0200 | [diff] [blame] | 81 | int sysctl_checksum; |
Alexey Dobriyan | c2a2c7e | 2008-10-08 11:35:08 +0200 | [diff] [blame] | 82 | unsigned int sysctl_log_invalid; /* Log invalid packets */ |
Eric Leblond | a900689 | 2012-04-18 11:20:41 +0200 | [diff] [blame] | 83 | int sysctl_auto_assign_helper; |
| 84 | bool auto_assign_helper_warned; |
Gao feng | 524a53e | 2012-05-28 21:04:10 +0000 | [diff] [blame] | 85 | struct nf_ip_net nf_ct_proto; |
Alexey Dobriyan | 8025070 | 2008-10-08 11:35:08 +0200 | [diff] [blame] | 86 | #ifdef CONFIG_SYSCTL |
| 87 | struct ctl_table_header *sysctl_header; |
Alexey Dobriyan | d716a4d | 2008-10-08 11:35:09 +0200 | [diff] [blame] | 88 | struct ctl_table_header *acct_sysctl_header; |
Pablo Neira Ayuso | a992ca2 | 2011-01-19 16:00:07 +0100 | [diff] [blame] | 89 | struct ctl_table_header *tstamp_sysctl_header; |
Pablo Neira Ayuso | a0891aa | 2009-06-13 12:26:29 +0200 | [diff] [blame] | 90 | struct ctl_table_header *event_sysctl_header; |
Eric Leblond | a900689 | 2012-04-18 11:20:41 +0200 | [diff] [blame] | 91 | struct ctl_table_header *helper_sysctl_header; |
Alexey Dobriyan | 8025070 | 2008-10-08 11:35:08 +0200 | [diff] [blame] | 92 | #endif |
Eric Dumazet | 5b3501f | 2010-02-08 11:16:56 -0800 | [diff] [blame] | 93 | char *slabname; |
Alexey Dobriyan | dfdb8d7 | 2008-10-08 11:35:02 +0200 | [diff] [blame] | 94 | }; |
| 95 | #endif |