ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / linux / netfilter_ipv4 / ip_conntrack_helper.h
1 /* IP connection tracking helpers. */
2 #ifndef _IP_CONNTRACK_HELPER_H
3 #define _IP_CONNTRACK_HELPER_H
4 #include <linux/netfilter_ipv4/ip_conntrack.h>
5
6 struct module;
7
8 /* Reuse expectation when max_expected reached */
9 #define IP_CT_HELPER_F_REUSE_EXPECT     0x01
10
11 struct ip_conntrack_helper
12 {       
13         struct list_head list;          /* Internal use. */
14
15         const char *name;               /* name of the module */
16         unsigned char flags;            /* Flags (see above) */
17         struct module *me;              /* pointer to self */
18         unsigned int max_expected;      /* Maximum number of concurrent 
19                                          * expected connections */
20         unsigned int timeout;           /* timeout for expecteds */
21
22         /* Mask of things we will help (compared against server response) */
23         struct ip_conntrack_tuple tuple;
24         struct ip_conntrack_tuple mask;
25         
26         /* Function to call when data passes; return verdict, or -1 to
27            invalidate. */
28         int (*help)(struct sk_buff *skb,
29                     struct ip_conntrack *ct,
30                     enum ip_conntrack_info conntrackinfo);
31 };
32
33 extern int ip_conntrack_helper_register(struct ip_conntrack_helper *);
34 extern void ip_conntrack_helper_unregister(struct ip_conntrack_helper *);
35
36 extern struct ip_conntrack_helper *ip_ct_find_helper(const struct ip_conntrack_tuple *tuple);
37
38
39 /* Allocate space for an expectation: this is mandatory before calling 
40    ip_conntrack_expect_related. */
41 extern struct ip_conntrack_expect *ip_conntrack_expect_alloc(void);
42 /* Add an expected connection: can have more than one per connection */
43 extern int ip_conntrack_expect_related(struct ip_conntrack_expect *exp,
44                                        struct ip_conntrack *related_to);
45 extern int ip_conntrack_change_expect(struct ip_conntrack_expect *expect,
46                                       struct ip_conntrack_tuple *newtuple);
47 extern void ip_conntrack_unexpect_related(struct ip_conntrack_expect *exp);
48
49 #endif /*_IP_CONNTRACK_HELPER_H*/