cpp-d1064d
[cross.git] / i686-linux-gnu-4.7 / usr / include / linux / netfilter / xt_policy.h
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef _XT_POLICY_H
3 #define _XT_POLICY_H
4
5 #include <linux/types.h>
6 #include <linux/in.h>
7 #include <linux/in6.h>
8
9 #define XT_POLICY_MAX_ELEM      4
10
11 enum xt_policy_flags {
12         XT_POLICY_MATCH_IN      = 0x1,
13         XT_POLICY_MATCH_OUT     = 0x2,
14         XT_POLICY_MATCH_NONE    = 0x4,
15         XT_POLICY_MATCH_STRICT  = 0x8,
16 };
17
18 enum xt_policy_modes {
19         XT_POLICY_MODE_TRANSPORT,
20         XT_POLICY_MODE_TUNNEL
21 };
22
23 struct xt_policy_spec {
24         __u8    saddr:1,
25                         daddr:1,
26                         proto:1,
27                         mode:1,
28                         spi:1,
29                         reqid:1;
30 };
31
32 union xt_policy_addr {
33         struct in_addr  a4;
34         struct in6_addr a6;
35 };
36
37 struct xt_policy_elem {
38         union {
39                 struct {
40                         union xt_policy_addr saddr;
41                         union xt_policy_addr smask;
42                         union xt_policy_addr daddr;
43                         union xt_policy_addr dmask;
44                 };
45         };
46         __be32                  spi;
47         __u32           reqid;
48         __u8            proto;
49         __u8            mode;
50
51         struct xt_policy_spec   match;
52         struct xt_policy_spec   invert;
53 };
54
55 struct xt_policy_info {
56         struct xt_policy_elem pol[XT_POLICY_MAX_ELEM];
57         __u16 flags;
58         __u16 len;
59 };
60
61 #endif /* _XT_POLICY_H */