conntrack.h 2.2 KB
Newer Older
1 2 3
#ifndef __NETNS_CONNTRACK_H
#define __NETNS_CONNTRACK_H

4
#include <linux/list.h>
5
#include <linux/list_nulls.h>
A
Arun Sharma 已提交
6
#include <linux/atomic.h>
7
#include <linux/netfilter/nf_conntrack_tcp.h>
8

9
struct ctl_table_header;
10 11
struct nf_conntrack_ecache;

12 13 14 15 16 17 18 19 20 21 22 23
struct nf_proto_net {
#ifdef CONFIG_SYSCTL
	struct ctl_table_header *ctl_table_header;
	struct ctl_table        *ctl_table;
#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
	struct ctl_table_header *ctl_compat_header;
	struct ctl_table        *ctl_compat_table;
#endif
#endif
	unsigned int		users;
};

24 25 26 27 28
struct nf_generic_net {
	struct nf_proto_net pn;
	unsigned int timeout;
};

29 30 31 32 33 34 35 36
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;
};

37 38 39 40 41 42 43 44 45 46 47
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];
};

48
struct nf_ip_net {
49
	struct nf_generic_net   generic;
50
	struct nf_tcp_net	tcp;
51
	struct nf_udp_net	udp;
52 53 54 55 56 57
#if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT)
	struct ctl_table_header *ctl_table_header;
	struct ctl_table	*ctl_table;
#endif
};

58
struct netns_ct {
59
	atomic_t		count;
60
	unsigned int		expect_count;
61
	unsigned int		htable_size;
62
	struct kmem_cache	*nf_conntrack_cachep;
63
	struct hlist_nulls_head	*hash;
64
	struct hlist_head	*expect_hash;
65
	struct hlist_nulls_head	unconfirmed;
66
	struct hlist_nulls_head	dying;
67
	struct ip_conntrack_stat __percpu *stat;
68 69
	struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb;
	struct nf_exp_event_notifier __rcu *nf_expect_event_cb;
70
	int			sysctl_events;
71
	unsigned int		sysctl_events_retry_timeout;
72
	int			sysctl_acct;
73
	int			sysctl_tstamp;
74
	int			sysctl_checksum;
75
	unsigned int		sysctl_log_invalid; /* Log invalid packets */
76 77
	int			sysctl_auto_assign_helper;
	bool			auto_assign_helper_warned;
78
	struct nf_ip_net	nf_ct_proto;
79 80
#ifdef CONFIG_SYSCTL
	struct ctl_table_header	*sysctl_header;
81
	struct ctl_table_header	*acct_sysctl_header;
82
	struct ctl_table_header	*tstamp_sysctl_header;
83
	struct ctl_table_header	*event_sysctl_header;
84
	struct ctl_table_header	*helper_sysctl_header;
85
#endif
86
	char			*slabname;
87 88
};
#endif