blob: fbcc7fa536dc4ab49440d4566e63fedf8b860d2a [file] [log] [blame]
Alexey Dobriyandfdb8d72008-10-08 11:35:02 +02001#ifndef __NETNS_CONNTRACK_H
2#define __NETNS_CONNTRACK_H
3
Alexey Dobriyan63c9a262008-10-08 11:35:04 +02004#include <linux/list.h>
Eric Dumazetea781f12009-03-25 21:05:46 +01005#include <linux/list_nulls.h>
Arun Sharma600634972011-07-26 16:09:06 -07006#include <linux/atomic.h>
Gao fengd2ba1fd2012-05-28 21:04:12 +00007#include <linux/netfilter/nf_conntrack_tcp.h>
Alexey Dobriyan49ac8712008-10-08 11:35:03 +02008
Alexey Dobriyan80250702008-10-08 11:35:08 +02009struct ctl_table_header;
Alexey Dobriyan6058fa62008-10-08 11:35:07 +020010struct nf_conntrack_ecache;
11
Gao feng2c352f42012-05-28 21:04:09 +000012struct 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 feng15f585b2012-05-28 21:04:11 +000024struct nf_generic_net {
25 struct nf_proto_net pn;
26 unsigned int timeout;
27};
28
Gao fengd2ba1fd2012-05-28 21:04:12 +000029struct 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 feng0ce490a2012-05-28 21:04:13 +000037enum udp_conntrack {
38 UDP_CT_UNREPLIED,
39 UDP_CT_REPLIED,
40 UDP_CT_MAX
41};
42
43struct nf_udp_net {
44 struct nf_proto_net pn;
45 unsigned int timeouts[UDP_CT_MAX];
46};
47
Gao feng4b626b92012-05-28 21:04:14 +000048struct nf_icmp_net {
49 struct nf_proto_net pn;
50 unsigned int timeout;
51};
52
Gao feng524a53e2012-05-28 21:04:10 +000053struct nf_ip_net {
Gao feng15f585b2012-05-28 21:04:11 +000054 struct nf_generic_net generic;
Gao fengd2ba1fd2012-05-28 21:04:12 +000055 struct nf_tcp_net tcp;
Gao feng0ce490a2012-05-28 21:04:13 +000056 struct nf_udp_net udp;
Gao feng4b626b92012-05-28 21:04:14 +000057 struct nf_icmp_net icmp;
Gao feng7080ba02012-05-28 21:04:15 +000058 struct nf_icmp_net icmpv6;
Gao feng524a53e2012-05-28 21:04:10 +000059#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 Dobriyandfdb8d72008-10-08 11:35:02 +020065struct netns_ct {
Alexey Dobriyan49ac8712008-10-08 11:35:03 +020066 atomic_t count;
Alexey Dobriyan9b03f382008-10-08 11:35:03 +020067 unsigned int expect_count;
Jesper Dangaard Brouer8cf4d6a2013-11-15 15:57:53 +010068#ifdef CONFIG_SYSCTL
69 struct ctl_table_header *sysctl_header;
70 struct ctl_table_header *acct_sysctl_header;
71 struct ctl_table_header *tstamp_sysctl_header;
72 struct ctl_table_header *event_sysctl_header;
73 struct ctl_table_header *helper_sysctl_header;
74#endif
75 char *slabname;
76 unsigned int sysctl_log_invalid; /* Log invalid packets */
77 unsigned int sysctl_events_retry_timeout;
78 int sysctl_events;
79 int sysctl_acct;
80 int sysctl_auto_assign_helper;
81 bool auto_assign_helper_warned;
82 int sysctl_tstamp;
83 int sysctl_checksum;
84
Patrick McHardyd696c7b2010-02-08 11:18:07 -080085 unsigned int htable_size;
Eric Dumazet5b3501f2010-02-08 11:16:56 -080086 struct kmem_cache *nf_conntrack_cachep;
Eric Dumazetea781f12009-03-25 21:05:46 +010087 struct hlist_nulls_head *hash;
Alexey Dobriyan9b03f382008-10-08 11:35:03 +020088 struct hlist_head *expect_hash;
Eric Dumazetea781f12009-03-25 21:05:46 +010089 struct hlist_nulls_head unconfirmed;
Pablo Neira Ayusodd7669a2009-06-13 12:30:52 +020090 struct hlist_nulls_head dying;
Pablo Neira Ayuso252b3e82012-12-11 04:07:42 +000091 struct hlist_nulls_head tmpl;
Tejun Heo7d720c32010-02-16 15:20:26 +000092 struct ip_conntrack_stat __percpu *stat;
Pablo Neira Ayuso70e99422011-11-22 00:16:51 +010093 struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb;
94 struct nf_exp_event_notifier __rcu *nf_expect_event_cb;
Gao feng524a53e2012-05-28 21:04:10 +000095 struct nf_ip_net nf_ct_proto;
Florian Westphalc539f012013-01-11 06:30:44 +000096#if defined(CONFIG_NF_CONNTRACK_LABELS)
97 unsigned int labels_used;
98 u8 label_words;
99#endif
Patrick McHardyc7232c92012-08-26 19:14:06 +0200100#ifdef CONFIG_NF_NAT_NEEDED
101 struct hlist_head *nat_bysource;
102 unsigned int nat_htable_size;
103#endif
Alexey Dobriyandfdb8d72008-10-08 11:35:02 +0200104};
105#endif