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>
8 /* Reuse expectation when max_expected reached */
9 #define IP_CT_HELPER_F_REUSE_EXPECT 0x01
11 struct ip_conntrack_helper
13 struct list_head list; /* Internal use. */
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 */
22 /* Mask of things we will help (compared against server response) */
23 struct ip_conntrack_tuple tuple;
24 struct ip_conntrack_tuple mask;
26 /* Function to call when data passes; return verdict, or -1 to
28 int (*help)(struct sk_buff *skb,
29 struct ip_conntrack *ct,
30 enum ip_conntrack_info conntrackinfo);
33 extern int ip_conntrack_helper_register(struct ip_conntrack_helper *);
34 extern void ip_conntrack_helper_unregister(struct ip_conntrack_helper *);
36 extern struct ip_conntrack_helper *ip_ct_find_helper(const struct ip_conntrack_tuple *tuple);
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);
49 #endif /*_IP_CONNTRACK_HELPER_H*/