2008-10-08 17:35:02 +08:00
|
|
|
#ifndef __NETNS_CONNTRACK_H
|
|
|
|
#define __NETNS_CONNTRACK_H
|
|
|
|
|
2008-10-08 17:35:04 +08:00
|
|
|
#include <linux/list.h>
|
2009-03-26 04:05:46 +08:00
|
|
|
#include <linux/list_nulls.h>
|
2011-07-27 07:09:06 +08:00
|
|
|
#include <linux/atomic.h>
|
2014-06-11 05:12:56 +08:00
|
|
|
#include <linux/workqueue.h>
|
2012-05-29 05:04:12 +08:00
|
|
|
#include <linux/netfilter/nf_conntrack_tcp.h>
|
2016-11-15 22:08:25 +08:00
|
|
|
#ifdef CONFIG_NF_CT_PROTO_DCCP
|
|
|
|
#include <linux/netfilter/nf_conntrack_dccp.h>
|
|
|
|
#endif
|
2016-11-15 22:08:26 +08:00
|
|
|
#ifdef CONFIG_NF_CT_PROTO_SCTP
|
|
|
|
#include <linux/netfilter/nf_conntrack_sctp.h>
|
|
|
|
#endif
|
2014-03-03 21:46:13 +08:00
|
|
|
#include <linux/seqlock.h>
|
2008-10-08 17:35:03 +08:00
|
|
|
|
2008-10-08 17:35:08 +08:00
|
|
|
struct ctl_table_header;
|
2008-10-08 17:35:07 +08:00
|
|
|
struct nf_conntrack_ecache;
|
|
|
|
|
2012-05-29 05:04:09 +08:00
|
|
|
struct nf_proto_net {
|
|
|
|
#ifdef CONFIG_SYSCTL
|
|
|
|
struct ctl_table_header *ctl_table_header;
|
|
|
|
struct ctl_table *ctl_table;
|
|
|
|
#endif
|
|
|
|
unsigned int users;
|
|
|
|
};
|
|
|
|
|
2012-05-29 05:04:11 +08:00
|
|
|
struct nf_generic_net {
|
|
|
|
struct nf_proto_net pn;
|
|
|
|
unsigned int timeout;
|
|
|
|
};
|
|
|
|
|
2012-05-29 05:04:12 +08:00
|
|
|
struct nf_tcp_net {
|
|
|
|
struct nf_proto_net pn;
|
|
|
|
unsigned int timeouts[TCP_CONNTRACK_TIMEOUT_MAX];
|
|
|
|
unsigned int tcp_loose;
|
|
|
|
unsigned int tcp_be_liberal;
|
|
|
|
unsigned int tcp_max_retrans;
|
|
|
|
};
|
|
|
|
|
2012-05-29 05:04:13 +08:00
|
|
|
enum udp_conntrack {
|
|
|
|
UDP_CT_UNREPLIED,
|
|
|
|
UDP_CT_REPLIED,
|
|
|
|
UDP_CT_MAX
|
|
|
|
};
|
|
|
|
|
|
|
|
struct nf_udp_net {
|
|
|
|
struct nf_proto_net pn;
|
|
|
|
unsigned int timeouts[UDP_CT_MAX];
|
|
|
|
};
|
|
|
|
|
2012-05-29 05:04:14 +08:00
|
|
|
struct nf_icmp_net {
|
|
|
|
struct nf_proto_net pn;
|
|
|
|
unsigned int timeout;
|
|
|
|
};
|
|
|
|
|
2016-11-15 22:08:25 +08:00
|
|
|
#ifdef CONFIG_NF_CT_PROTO_DCCP
|
|
|
|
struct nf_dccp_net {
|
|
|
|
struct nf_proto_net pn;
|
|
|
|
int dccp_loose;
|
|
|
|
unsigned int dccp_timeout[CT_DCCP_MAX + 1];
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2016-11-15 22:08:26 +08:00
|
|
|
#ifdef CONFIG_NF_CT_PROTO_SCTP
|
|
|
|
struct nf_sctp_net {
|
|
|
|
struct nf_proto_net pn;
|
|
|
|
unsigned int timeouts[SCTP_CONNTRACK_MAX];
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2016-11-15 22:08:27 +08:00
|
|
|
#ifdef CONFIG_NF_CT_PROTO_UDPLITE
|
|
|
|
enum udplite_conntrack {
|
|
|
|
UDPLITE_CT_UNREPLIED,
|
|
|
|
UDPLITE_CT_REPLIED,
|
|
|
|
UDPLITE_CT_MAX
|
|
|
|
};
|
|
|
|
|
|
|
|
struct nf_udplite_net {
|
|
|
|
struct nf_proto_net pn;
|
|
|
|
unsigned int timeouts[UDPLITE_CT_MAX];
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2012-05-29 05:04:10 +08:00
|
|
|
struct nf_ip_net {
|
2012-05-29 05:04:11 +08:00
|
|
|
struct nf_generic_net generic;
|
2012-05-29 05:04:12 +08:00
|
|
|
struct nf_tcp_net tcp;
|
2012-05-29 05:04:13 +08:00
|
|
|
struct nf_udp_net udp;
|
2012-05-29 05:04:14 +08:00
|
|
|
struct nf_icmp_net icmp;
|
2012-05-29 05:04:15 +08:00
|
|
|
struct nf_icmp_net icmpv6;
|
2016-11-15 22:08:25 +08:00
|
|
|
#ifdef CONFIG_NF_CT_PROTO_DCCP
|
|
|
|
struct nf_dccp_net dccp;
|
|
|
|
#endif
|
2016-11-15 22:08:26 +08:00
|
|
|
#ifdef CONFIG_NF_CT_PROTO_SCTP
|
|
|
|
struct nf_sctp_net sctp;
|
|
|
|
#endif
|
2016-11-15 22:08:27 +08:00
|
|
|
#ifdef CONFIG_NF_CT_PROTO_UDPLITE
|
|
|
|
struct nf_udplite_net udplite;
|
|
|
|
#endif
|
2012-05-29 05:04:10 +08:00
|
|
|
};
|
|
|
|
|
2014-03-03 21:45:20 +08:00
|
|
|
struct ct_pcpu {
|
|
|
|
spinlock_t lock;
|
|
|
|
struct hlist_nulls_head unconfirmed;
|
|
|
|
struct hlist_nulls_head dying;
|
|
|
|
};
|
|
|
|
|
2008-10-08 17:35:02 +08:00
|
|
|
struct netns_ct {
|
2008-10-08 17:35:03 +08:00
|
|
|
atomic_t count;
|
2008-10-08 17:35:03 +08:00
|
|
|
unsigned int expect_count;
|
2014-06-11 05:12:56 +08:00
|
|
|
#ifdef CONFIG_NF_CONNTRACK_EVENTS
|
|
|
|
struct delayed_work ecache_dwork;
|
|
|
|
bool ecache_dwork_pending;
|
|
|
|
#endif
|
2013-11-15 22:57:53 +08:00
|
|
|
#ifdef CONFIG_SYSCTL
|
|
|
|
struct ctl_table_header *sysctl_header;
|
|
|
|
struct ctl_table_header *acct_sysctl_header;
|
|
|
|
struct ctl_table_header *tstamp_sysctl_header;
|
|
|
|
struct ctl_table_header *event_sysctl_header;
|
|
|
|
struct ctl_table_header *helper_sysctl_header;
|
|
|
|
#endif
|
|
|
|
unsigned int sysctl_log_invalid; /* Log invalid packets */
|
|
|
|
int sysctl_events;
|
|
|
|
int sysctl_acct;
|
|
|
|
int sysctl_auto_assign_helper;
|
|
|
|
bool auto_assign_helper_warned;
|
|
|
|
int sysctl_tstamp;
|
|
|
|
int sysctl_checksum;
|
|
|
|
|
2014-03-03 21:45:20 +08:00
|
|
|
struct ct_pcpu __percpu *pcpu_lists;
|
2010-02-16 23:20:26 +08:00
|
|
|
struct ip_conntrack_stat __percpu *stat;
|
2011-11-22 07:16:51 +08:00
|
|
|
struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb;
|
|
|
|
struct nf_exp_event_notifier __rcu *nf_expect_event_cb;
|
2012-05-29 05:04:10 +08:00
|
|
|
struct nf_ip_net nf_ct_proto;
|
2013-01-11 14:30:44 +08:00
|
|
|
#if defined(CONFIG_NF_CONNTRACK_LABELS)
|
|
|
|
unsigned int labels_used;
|
|
|
|
#endif
|
2008-10-08 17:35:02 +08:00
|
|
|
};
|
|
|
|
#endif
|