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)(const struct iphdr *, size_t len,
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 /* Add an expected connection: can have more than one per connection */
39 extern int ip_conntrack_expect_related(struct ip_conntrack *related_to,
40 				       struct ip_conntrack_expect *exp);
41 extern int ip_conntrack_change_expect(struct ip_conntrack_expect *expect,
42 				      struct ip_conntrack_tuple *newtuple);
43 extern void ip_conntrack_unexpect_related(struct ip_conntrack_expect *exp);
44 
45 #endif /*_IP_CONNTRACK_HELPER_H*/
46