1 #ifndef _IP_CONNTRACK_CORE_H
2 #define _IP_CONNTRACK_CORE_H
3 #include <linux/netfilter.h>
5 /* This header is used to share core functionality between the
6 standalone connection tracking module, and the compatibility layer's use
7 of connection tracking. */
8 extern unsigned int ip_conntrack_in(unsigned int hooknum,
10 const struct net_device *in,
11 const struct net_device *out,
12 int (*okfn)(struct sk_buff *));
14 extern int ip_conntrack_init(void);
15 extern void ip_conntrack_cleanup(void);
17 struct ip_conntrack_protocol;
20 ip_ct_get_tuple(const struct iphdr *iph,
21 const struct sk_buff *skb,
23 struct ip_conntrack_tuple *tuple,
24 const struct ip_conntrack_protocol *protocol);
27 ip_ct_invert_tuple(struct ip_conntrack_tuple *inverse,
28 const struct ip_conntrack_tuple *orig,
29 const struct ip_conntrack_protocol *protocol);
31 /* Find a connection corresponding to a tuple. */
32 struct ip_conntrack_tuple_hash *
33 ip_conntrack_find_get(const struct ip_conntrack_tuple *tuple,
34 const struct ip_conntrack *ignored_conntrack);
36 extern int __ip_conntrack_confirm(struct sk_buff **pskb);
38 /* Confirm a connection: returns NF_DROP if packet must be dropped. */
39 static inline int ip_conntrack_confirm(struct sk_buff **pskb)
42 && !is_confirmed((struct ip_conntrack *)(*pskb)->nfct))
43 return __ip_conntrack_confirm(pskb);
47 extern struct list_head *ip_conntrack_hash;
48 extern struct list_head ip_conntrack_expect_list;
49 extern rwlock_t ip_conntrack_lock;
50 #endif /* _IP_CONNTRACK_CORE_H */