[NETFILTER]: nf_conntrack_netlink: sync expectation dumping with conntrack table...
[deliverable/linux.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
6823645d
PM
9extern struct list_head nf_ct_expect_list;
10extern struct kmem_cache *nf_ct_expect_cachep;
54047320 11extern const struct file_operations exp_file_ops;
77ab9cff
MJ
12
13struct nf_conntrack_expect
14{
15 /* Internal linked list (global expectation list) */
16 struct list_head list;
17
18 /* We expect this tuple, with the following mask */
d4156e8c
PM
19 struct nf_conntrack_tuple tuple;
20 struct nf_conntrack_tuple_mask mask;
77ab9cff
MJ
21
22 /* Function to call after setup and insertion */
23 void (*expectfn)(struct nf_conn *new,
24 struct nf_conntrack_expect *this);
25
9457d851
PM
26 /* Helper to assign to new connection */
27 struct nf_conntrack_helper *helper;
28
77ab9cff
MJ
29 /* The conntrack of the master connection */
30 struct nf_conn *master;
31
32 /* Timer function; deletes the expectation. */
33 struct timer_list timeout;
34
35 /* Usage count. */
36 atomic_t use;
37
38 /* Unique ID */
39 unsigned int id;
40
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
52};
53
54#define NF_CT_EXPECT_PERMANENT 0x1
55
56
57struct nf_conntrack_expect *
6823645d 58__nf_ct_expect_find(const struct nf_conntrack_tuple *tuple);
77ab9cff
MJ
59
60struct nf_conntrack_expect *
6823645d 61nf_ct_expect_find_get(const struct nf_conntrack_tuple *tuple);
77ab9cff
MJ
62
63struct nf_conntrack_expect *
6823645d 64nf_ct_find_expectation(const struct nf_conntrack_tuple *tuple);
77ab9cff
MJ
65
66void nf_ct_unlink_expect(struct nf_conntrack_expect *exp);
67void nf_ct_remove_expectations(struct nf_conn *ct);
6823645d 68void nf_ct_unexpect_related(struct nf_conntrack_expect *exp);
77ab9cff
MJ
69
70/* Allocate space for an expectation: this is mandatory before calling
6823645d
PM
71 nf_ct_expect_related. You will have to call put afterwards. */
72struct nf_conntrack_expect *nf_ct_expect_alloc(struct nf_conn *me);
73void nf_ct_expect_init(struct nf_conntrack_expect *, int,
74 union nf_conntrack_address *,
75 union nf_conntrack_address *,
76 u_int8_t, __be16 *, __be16 *);
77void nf_ct_expect_put(struct nf_conntrack_expect *exp);
78int nf_ct_expect_related(struct nf_conntrack_expect *expect);
77ab9cff
MJ
79
80#endif /*_NF_CONNTRACK_EXPECT_H*/
81
This page took 0.093594 seconds and 5 git commands to generate.