2 * connection tracking expectations.
5 #ifndef _NF_CONNTRACK_EXPECT_H
6 #define _NF_CONNTRACK_EXPECT_H
7 #include <net/netfilter/nf_conntrack.h>
9 extern struct list_head nf_conntrack_expect_list;
10 extern kmem_cache_t *nf_conntrack_expect_cachep;
11 extern struct file_operations exp_file_ops;
13 struct nf_conntrack_expect
15 /* Internal linked list (global expectation list) */
16 struct list_head list;
18 /* We expect this tuple, with the following mask */
19 struct nf_conntrack_tuple tuple, mask;
21 /* Function to call after setup and insertion */
22 void (*expectfn)(struct nf_conn *new,
23 struct nf_conntrack_expect *this);
25 /* The conntrack of the master connection */
26 struct nf_conn *master;
28 /* Timer function; deletes the expectation. */
29 struct timer_list timeout;
40 #ifdef CONFIG_NF_NAT_NEEDED
41 /* This is the original per-proto part, used to map the
42 * expected connection the way the recipient expects. */
43 union nf_conntrack_manip_proto saved_proto;
44 /* Direction relative to the master connection. */
45 enum ip_conntrack_dir dir;
49 #define NF_CT_EXPECT_PERMANENT 0x1
52 struct nf_conntrack_expect *
53 __nf_conntrack_expect_find(const struct nf_conntrack_tuple *tuple);
55 struct nf_conntrack_expect *
56 nf_conntrack_expect_find(const struct nf_conntrack_tuple *tuple);
58 struct nf_conntrack_expect *
59 find_expectation(const struct nf_conntrack_tuple *tuple);
61 void nf_ct_unlink_expect(struct nf_conntrack_expect *exp);
62 void nf_ct_remove_expectations(struct nf_conn *ct);
63 void nf_conntrack_unexpect_related(struct nf_conntrack_expect *exp);
65 /* Allocate space for an expectation: this is mandatory before calling
66 nf_conntrack_expect_related. You will have to call put afterwards. */
67 struct nf_conntrack_expect *nf_conntrack_expect_alloc(struct nf_conn *me);
68 void nf_conntrack_expect_put(struct nf_conntrack_expect *exp);
69 int nf_conntrack_expect_related(struct nf_conntrack_expect *expect);
71 #endif /*_NF_CONNTRACK_EXPECT_H*/