cpp-d1064d
[cross.git] / i686-linux-gnu-4.7 / usr / include / linux / netfilter / nf_conntrack_tuple_common.h
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef _NF_CONNTRACK_TUPLE_COMMON_H
3 #define _NF_CONNTRACK_TUPLE_COMMON_H
4
5 #include <linux/types.h>
6 #include <linux/netfilter.h>
7 #include <linux/netfilter/nf_conntrack_common.h> /* IP_CT_IS_REPLY */
8
9 enum ip_conntrack_dir {
10         IP_CT_DIR_ORIGINAL,
11         IP_CT_DIR_REPLY,
12         IP_CT_DIR_MAX
13 };
14
15 /* The protocol-specific manipulable parts of the tuple: always in
16  * network order
17  */
18 union nf_conntrack_man_proto {
19         /* Add other protocols here. */
20         __be16 all;
21
22         struct {
23                 __be16 port;
24         } tcp;
25         struct {
26                 __be16 port;
27         } udp;
28         struct {
29                 __be16 id;
30         } icmp;
31         struct {
32                 __be16 port;
33         } dccp;
34         struct {
35                 __be16 port;
36         } sctp;
37         struct {
38                 __be16 key;     /* GRE key is 32bit, PPtP only uses 16bit */
39         } gre;
40 };
41
42 #define CTINFO2DIR(ctinfo) ((ctinfo) >= IP_CT_IS_REPLY ? IP_CT_DIR_REPLY : IP_CT_DIR_ORIGINAL)
43
44 #endif /* _NF_CONNTRACK_TUPLE_COMMON_H */