]>
Commit | Line | Data |
---|---|---|
9fb9cbb1 YK |
1 | /* |
2 | * This header is used to share core functionality between the | |
3 | * standalone connection tracking module, and the compatibility layer's use | |
4 | * of connection tracking. | |
5 | * | |
6 | * 16 Dec 2003: Yasuyuki Kozakai @USAGI <yasuyuki.kozakai@toshiba.co.jp> | |
7 | * - generalize L3 protocol dependent part. | |
8 | * | |
9 | * Derived from include/linux/netfiter_ipv4/ip_conntrack_core.h | |
10 | */ | |
11 | ||
12 | #ifndef _NF_CONNTRACK_CORE_H | |
13 | #define _NF_CONNTRACK_CORE_H | |
14 | ||
15 | #include <linux/netfilter.h> | |
77ab9cff | 16 | #include <net/netfilter/nf_conntrack_l3proto.h> |
605dcad6 | 17 | #include <net/netfilter/nf_conntrack_l4proto.h> |
f6180121 | 18 | #include <net/netfilter/nf_conntrack_ecache.h> |
9fb9cbb1 YK |
19 | |
20 | /* This header is used to share core functionality between the | |
21 | standalone connection tracking module, and the compatibility layer's use | |
22 | of connection tracking. */ | |
76108cea | 23 | extern unsigned int nf_conntrack_in(u_int8_t pf, |
9fb9cbb1 | 24 | unsigned int hooknum, |
3db05fea | 25 | struct sk_buff *skb); |
9fb9cbb1 YK |
26 | |
27 | extern int nf_conntrack_init(void); | |
28 | extern void nf_conntrack_cleanup(void); | |
29 | ||
ac5357eb PM |
30 | extern int nf_conntrack_proto_init(void); |
31 | extern void nf_conntrack_proto_fini(void); | |
32 | ||
5f2b4c90 | 33 | extern bool |
9fb9cbb1 YK |
34 | nf_ct_get_tuple(const struct sk_buff *skb, |
35 | unsigned int nhoff, | |
36 | unsigned int dataoff, | |
37 | u_int16_t l3num, | |
38 | u_int8_t protonum, | |
39 | struct nf_conntrack_tuple *tuple, | |
40 | const struct nf_conntrack_l3proto *l3proto, | |
605dcad6 | 41 | const struct nf_conntrack_l4proto *l4proto); |
9fb9cbb1 | 42 | |
5f2b4c90 | 43 | extern bool |
9fb9cbb1 YK |
44 | nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse, |
45 | const struct nf_conntrack_tuple *orig, | |
46 | const struct nf_conntrack_l3proto *l3proto, | |
605dcad6 | 47 | const struct nf_conntrack_l4proto *l4proto); |
9fb9cbb1 YK |
48 | |
49 | /* Find a connection corresponding to a tuple. */ | |
50 | extern struct nf_conntrack_tuple_hash * | |
330f7db5 | 51 | nf_conntrack_find_get(const struct nf_conntrack_tuple *tuple); |
9fb9cbb1 | 52 | |
3db05fea | 53 | extern int __nf_conntrack_confirm(struct sk_buff *skb); |
9fb9cbb1 YK |
54 | |
55 | /* Confirm a connection: returns NF_DROP if packet must be dropped. */ | |
3db05fea | 56 | static inline int nf_conntrack_confirm(struct sk_buff *skb) |
9fb9cbb1 | 57 | { |
3db05fea | 58 | struct nf_conn *ct = (struct nf_conn *)skb->nfct; |
9fb9cbb1 YK |
59 | int ret = NF_ACCEPT; |
60 | ||
61 | if (ct) { | |
ec68e97d | 62 | if (!nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct)) |
3db05fea | 63 | ret = __nf_conntrack_confirm(skb); |
9fb9cbb1 YK |
64 | nf_ct_deliver_cached_events(ct); |
65 | } | |
66 | return ret; | |
67 | } | |
68 | ||
77ab9cff MJ |
69 | int |
70 | print_tuple(struct seq_file *s, const struct nf_conntrack_tuple *tuple, | |
32948588 JE |
71 | const struct nf_conntrack_l3proto *l3proto, |
72 | const struct nf_conntrack_l4proto *proto); | |
77ab9cff | 73 | |
f205c5e0 | 74 | extern struct hlist_head *nf_conntrack_hash; |
f8ba1aff | 75 | extern spinlock_t nf_conntrack_lock ; |
f205c5e0 | 76 | extern struct hlist_head unconfirmed; |
7e5d03bb | 77 | |
9fb9cbb1 | 78 | #endif /* _NF_CONNTRACK_CORE_H */ |