]> bbs.cooldavid.org Git - net-next-2.6.git/blame - include/net/netfilter/nf_conntrack_expect.h
[NETFILTER]: nf_conntrack_expect: show NF_CT_EXPECT_PERMANENT flag in /proc
[net-next-2.6.git] / include / net / netfilter / nf_conntrack_expect.h
CommitLineData
77ab9cff
MJ
1/*
2 * connection tracking expectations.
3 */
4
5#ifndef _NF_CONNTRACK_EXPECT_H
6#define _NF_CONNTRACK_EXPECT_H
7#include <net/netfilter/nf_conntrack.h>
8
a71c0855
PM
9extern struct hlist_head *nf_ct_expect_hash;
10extern unsigned int nf_ct_expect_hsize;
f264a7df 11extern unsigned int nf_ct_expect_max;
77ab9cff
MJ
12
13struct nf_conntrack_expect
14{
b560580a
PM
15 /* Conntrack expectation list member */
16 struct hlist_node lnode;
77ab9cff 17
a71c0855
PM
18 /* Hash member */
19 struct hlist_node hnode;
20
77ab9cff 21 /* We expect this tuple, with the following mask */
d4156e8c
PM
22 struct nf_conntrack_tuple tuple;
23 struct nf_conntrack_tuple_mask mask;
77ab9cff
MJ
24
25 /* Function to call after setup and insertion */
26 void (*expectfn)(struct nf_conn *new,
27 struct nf_conntrack_expect *this);
28
9457d851
PM
29 /* Helper to assign to new connection */
30 struct nf_conntrack_helper *helper;
31
77ab9cff
MJ
32 /* The conntrack of the master connection */
33 struct nf_conn *master;
34
35 /* Timer function; deletes the expectation. */
36 struct timer_list timeout;
37
38 /* Usage count. */
39 atomic_t use;
40
77ab9cff
MJ
41 /* Flags */
42 unsigned int flags;
43
44#ifdef CONFIG_NF_NAT_NEEDED
f587de0e 45 __be32 saved_ip;
77ab9cff
MJ
46 /* This is the original per-proto part, used to map the
47 * expected connection the way the recipient expects. */
5b1158e9 48 union nf_conntrack_man_proto saved_proto;
77ab9cff
MJ
49 /* Direction relative to the master connection. */
50 enum ip_conntrack_dir dir;
51#endif
7d0742da
PM
52
53 struct rcu_head rcu;
77ab9cff
MJ
54};
55
56#define NF_CT_EXPECT_PERMANENT 0x1
57
e9c1b084
PM
58int nf_conntrack_expect_init(void);
59void nf_conntrack_expect_fini(void);
77ab9cff
MJ
60
61struct nf_conntrack_expect *
6823645d 62__nf_ct_expect_find(const struct nf_conntrack_tuple *tuple);
77ab9cff
MJ
63
64struct nf_conntrack_expect *
6823645d 65nf_ct_expect_find_get(const struct nf_conntrack_tuple *tuple);
77ab9cff
MJ
66
67struct nf_conntrack_expect *
6823645d 68nf_ct_find_expectation(const struct nf_conntrack_tuple *tuple);
77ab9cff
MJ
69
70void nf_ct_unlink_expect(struct nf_conntrack_expect *exp);
71void nf_ct_remove_expectations(struct nf_conn *ct);
6823645d 72void nf_ct_unexpect_related(struct nf_conntrack_expect *exp);
77ab9cff
MJ
73
74/* Allocate space for an expectation: this is mandatory before calling
6823645d
PM
75 nf_ct_expect_related. You will have to call put afterwards. */
76struct nf_conntrack_expect *nf_ct_expect_alloc(struct nf_conn *me);
77void nf_ct_expect_init(struct nf_conntrack_expect *, int,
1d9d7522
PM
78 const union nf_inet_addr *,
79 const union nf_inet_addr *,
80 u_int8_t, const __be16 *, const __be16 *);
6823645d
PM
81void nf_ct_expect_put(struct nf_conntrack_expect *exp);
82int nf_ct_expect_related(struct nf_conntrack_expect *expect);
77ab9cff
MJ
83
84#endif /*_NF_CONNTRACK_EXPECT_H*/
85