blob: e469e85de3f9cad8c3b3573c6c5846d7c6303106 [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>
Florian Westphal95005072014-06-10 23:12:56 +02007#include <linux/workqueue.h>
Gao fengd2ba1fd2012-05-28 21:04:12 +00008#include <linux/netfilter/nf_conntrack_tcp.h>
Jesper Dangaard Brouer93bb0ce2014-03-03 14:46:13 +01009#include <linux/seqlock.h>
Alexey Dobriyan49ac8712008-10-08 11:35:03 +020010
Alexey Dobriyan80250702008-10-08 11:35:08 +020011struct ctl_table_header;
Alexey Dobriyan6058fa62008-10-08 11:35:07 +020012struct nf_conntrack_ecache;
13
Gao feng2c352f42012-05-28 21:04:09 +000014struct nf_proto_net {
15#ifdef CONFIG_SYSCTL
16 struct ctl_table_header *ctl_table_header;
17 struct ctl_table *ctl_table;
Gao feng2c352f42012-05-28 21:04:09 +000018#endif
19 unsigned int users;
20};
21
Gao feng15f585b2012-05-28 21:04:11 +000022struct nf_generic_net {
23 struct nf_proto_net pn;
24 unsigned int timeout;
25};
26
Gao fengd2ba1fd2012-05-28 21:04:12 +000027struct nf_tcp_net {
28 struct nf_proto_net pn;
29 unsigned int timeouts[TCP_CONNTRACK_TIMEOUT_MAX];
30 unsigned int tcp_loose;
31 unsigned int tcp_be_liberal;
32 unsigned int tcp_max_retrans;
33};
34
Gao feng0ce490a2012-05-28 21:04:13 +000035enum udp_conntrack {
36 UDP_CT_UNREPLIED,
37 UDP_CT_REPLIED,
38 UDP_CT_MAX
39};
40
41struct nf_udp_net {
42 struct nf_proto_net pn;
43 unsigned int timeouts[UDP_CT_MAX];
44};
45
Gao feng4b626b92012-05-28 21:04:14 +000046struct nf_icmp_net {
47 struct nf_proto_net pn;
48 unsigned int timeout;
49};
50
Gao feng524a53e2012-05-28 21:04:10 +000051struct nf_ip_net {
Gao feng15f585b2012-05-28 21:04:11 +000052 struct nf_generic_net generic;
Gao fengd2ba1fd2012-05-28 21:04:12 +000053 struct nf_tcp_net tcp;
Gao feng0ce490a2012-05-28 21:04:13 +000054 struct nf_udp_net udp;
Gao feng4b626b92012-05-28 21:04:14 +000055 struct nf_icmp_net icmp;
Gao feng7080ba02012-05-28 21:04:15 +000056 struct nf_icmp_net icmpv6;
Gao feng524a53e2012-05-28 21:04:10 +000057};
58
Jesper Dangaard Brouerb7779d02014-03-03 14:45:20 +010059struct ct_pcpu {
60 spinlock_t lock;
61 struct hlist_nulls_head unconfirmed;
62 struct hlist_nulls_head dying;
Jesper Dangaard Brouerb7779d02014-03-03 14:45:20 +010063};
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;
Florian Westphal95005072014-06-10 23:12:56 +020068#ifdef CONFIG_NF_CONNTRACK_EVENTS
69 struct delayed_work ecache_dwork;
70 bool ecache_dwork_pending;
71#endif
Jesper Dangaard Brouer8cf4d6a2013-11-15 15:57:53 +010072#ifdef CONFIG_SYSCTL
73 struct ctl_table_header *sysctl_header;
74 struct ctl_table_header *acct_sysctl_header;
75 struct ctl_table_header *tstamp_sysctl_header;
76 struct ctl_table_header *event_sysctl_header;
77 struct ctl_table_header *helper_sysctl_header;
78#endif
Jesper Dangaard Brouer8cf4d6a2013-11-15 15:57:53 +010079 unsigned int sysctl_log_invalid; /* Log invalid packets */
Jesper Dangaard Brouer8cf4d6a2013-11-15 15:57:53 +010080 int sysctl_events;
81 int sysctl_acct;
82 int sysctl_auto_assign_helper;
83 bool auto_assign_helper_warned;
84 int sysctl_tstamp;
85 int sysctl_checksum;
86
Jesper Dangaard Brouerb7779d02014-03-03 14:45:20 +010087 struct ct_pcpu __percpu *pcpu_lists;
Tejun Heo7d720c32010-02-16 15:20:26 +000088 struct ip_conntrack_stat __percpu *stat;
Pablo Neira Ayuso70e99422011-11-22 00:16:51 +010089 struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb;
90 struct nf_exp_event_notifier __rcu *nf_expect_event_cb;
Gao feng524a53e2012-05-28 21:04:10 +000091 struct nf_ip_net nf_ct_proto;
Florian Westphalc539f012013-01-11 06:30:44 +000092#if defined(CONFIG_NF_CONNTRACK_LABELS)
93 unsigned int labels_used;
94 u8 label_words;
95#endif
Alexey Dobriyandfdb8d72008-10-08 11:35:02 +020096};
97#endif