conntrack.h 2.63 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>
Arun Sharma's avatar
Arun Sharma committed
6
#include <linux/atomic.h>
7
#include <linux/netfilter/nf_conntrack_tcp.h>
8
#include <linux/seqlock.h>
9

10
struct ctl_table_header;
11 12
struct nf_conntrack_ecache;

13 14 15 16 17 18 19 20 21 22 23 24
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;
};

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

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

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

49 50 51 52 53
struct nf_icmp_net {
	struct nf_proto_net pn;
	unsigned int timeout;
};

54
struct nf_ip_net {
55
	struct nf_generic_net   generic;
56
	struct nf_tcp_net	tcp;
57
	struct nf_udp_net	udp;
58
	struct nf_icmp_net	icmp;
59
	struct nf_icmp_net	icmpv6;
60 61 62 63 64 65
#if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT)
	struct ctl_table_header *ctl_table_header;
	struct ctl_table	*ctl_table;
#endif
};

66 67 68 69 70 71 72
struct ct_pcpu {
	spinlock_t		lock;
	struct hlist_nulls_head unconfirmed;
	struct hlist_nulls_head dying;
	struct hlist_nulls_head tmpl;
};

73
struct netns_ct {
74
	atomic_t		count;
75
	unsigned int		expect_count;
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
#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
	char			*slabname;
	unsigned int		sysctl_log_invalid; /* Log invalid packets */
	unsigned int		sysctl_events_retry_timeout;
	int			sysctl_events;
	int			sysctl_acct;
	int			sysctl_auto_assign_helper;
	bool			auto_assign_helper_warned;
	int			sysctl_tstamp;
	int			sysctl_checksum;

93
	unsigned int		htable_size;
94
	seqcount_t		generation;
95
	struct kmem_cache	*nf_conntrack_cachep;
96
	struct hlist_nulls_head	*hash;
97
	struct hlist_head	*expect_hash;
98
	struct ct_pcpu __percpu *pcpu_lists;
99
	struct ip_conntrack_stat __percpu *stat;
100 101
	struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb;
	struct nf_exp_event_notifier __rcu *nf_expect_event_cb;
102
	struct nf_ip_net	nf_ct_proto;
103 104 105 106
#if defined(CONFIG_NF_CONNTRACK_LABELS)
	unsigned int		labels_used;
	u8			label_words;
#endif
107 108 109 110
#ifdef CONFIG_NF_NAT_NEEDED
	struct hlist_head	*nat_bysource;
	unsigned int		nat_htable_size;
#endif
111 112
};
#endif