Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next
[linux-2.6-microblaze.git] / include / linux / netfilter / nf_conntrack_proto_gre.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _CONNTRACK_PROTO_GRE_H
3 #define _CONNTRACK_PROTO_GRE_H
4 #include <asm/byteorder.h>
5 #include <net/gre.h>
6 #include <net/pptp.h>
7
8 struct nf_ct_gre {
9         unsigned int stream_timeout;
10         unsigned int timeout;
11 };
12
13 #ifdef __KERNEL__
14 #include <net/netfilter/nf_conntrack_tuple.h>
15
16 struct nf_conn;
17
18 /* structure for original <-> reply keymap */
19 struct nf_ct_gre_keymap {
20         struct list_head list;
21         struct nf_conntrack_tuple tuple;
22 };
23
24 enum grep_conntrack {
25         GRE_CT_UNREPLIED,
26         GRE_CT_REPLIED,
27         GRE_CT_MAX
28 };
29
30 struct netns_proto_gre {
31         struct nf_proto_net     nf;
32         rwlock_t                keymap_lock;
33         struct list_head        keymap_list;
34         unsigned int            gre_timeouts[GRE_CT_MAX];
35 };
36
37 /* add new tuple->key_reply pair to keymap */
38 int nf_ct_gre_keymap_add(struct nf_conn *ct, enum ip_conntrack_dir dir,
39                          struct nf_conntrack_tuple *t);
40
41 /* delete keymap entries */
42 void nf_ct_gre_keymap_destroy(struct nf_conn *ct);
43
44 #endif /* __KERNEL__ */
45 #endif /* _CONNTRACK_PROTO_GRE_H */