Patrick McHardy | c4b8851 | 2006-03-20 18:03:40 -0800 | [diff] [blame] | 1 | #ifndef _XT_POLICY_H |
| 2 | #define _XT_POLICY_H |
| 3 | |
Arnd Bergmann | 60c195c | 2009-02-26 00:51:43 +0100 | [diff] [blame] | 4 | #include <linux/types.h> |
| 5 | |
Patrick McHardy | c4b8851 | 2006-03-20 18:03:40 -0800 | [diff] [blame] | 6 | #define XT_POLICY_MAX_ELEM 4 |
| 7 | |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 8 | enum xt_policy_flags { |
Patrick McHardy | c4b8851 | 2006-03-20 18:03:40 -0800 | [diff] [blame] | 9 | XT_POLICY_MATCH_IN = 0x1, |
| 10 | XT_POLICY_MATCH_OUT = 0x2, |
| 11 | XT_POLICY_MATCH_NONE = 0x4, |
| 12 | XT_POLICY_MATCH_STRICT = 0x8, |
| 13 | }; |
| 14 | |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 15 | enum xt_policy_modes { |
Patrick McHardy | c4b8851 | 2006-03-20 18:03:40 -0800 | [diff] [blame] | 16 | XT_POLICY_MODE_TRANSPORT, |
| 17 | XT_POLICY_MODE_TUNNEL |
| 18 | }; |
| 19 | |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 20 | struct xt_policy_spec { |
Arnd Bergmann | 60c195c | 2009-02-26 00:51:43 +0100 | [diff] [blame] | 21 | __u8 saddr:1, |
Patrick McHardy | c4b8851 | 2006-03-20 18:03:40 -0800 | [diff] [blame] | 22 | daddr:1, |
| 23 | proto:1, |
| 24 | mode:1, |
| 25 | spi:1, |
| 26 | reqid:1; |
| 27 | }; |
| 28 | |
Jan Engelhardt | 917b6fb | 2008-01-14 23:42:06 -0800 | [diff] [blame] | 29 | #ifndef __KERNEL__ |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 30 | union xt_policy_addr { |
Patrick McHardy | c4b8851 | 2006-03-20 18:03:40 -0800 | [diff] [blame] | 31 | struct in_addr a4; |
| 32 | struct in6_addr a6; |
| 33 | }; |
Jan Engelhardt | 917b6fb | 2008-01-14 23:42:06 -0800 | [diff] [blame] | 34 | #endif |
Patrick McHardy | c4b8851 | 2006-03-20 18:03:40 -0800 | [diff] [blame] | 35 | |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 36 | struct xt_policy_elem { |
Jan Engelhardt | 917b6fb | 2008-01-14 23:42:06 -0800 | [diff] [blame] | 37 | union { |
| 38 | #ifdef __KERNEL__ |
| 39 | struct { |
| 40 | union nf_inet_addr saddr; |
| 41 | union nf_inet_addr smask; |
| 42 | union nf_inet_addr daddr; |
| 43 | union nf_inet_addr dmask; |
| 44 | }; |
| 45 | #else |
| 46 | struct { |
| 47 | union xt_policy_addr saddr; |
| 48 | union xt_policy_addr smask; |
| 49 | union xt_policy_addr daddr; |
| 50 | union xt_policy_addr dmask; |
| 51 | }; |
| 52 | #endif |
| 53 | }; |
Al Viro | 98a4a86 | 2006-11-08 00:26:51 -0800 | [diff] [blame] | 54 | __be32 spi; |
Arnd Bergmann | 60c195c | 2009-02-26 00:51:43 +0100 | [diff] [blame] | 55 | __u32 reqid; |
| 56 | __u8 proto; |
| 57 | __u8 mode; |
Patrick McHardy | c4b8851 | 2006-03-20 18:03:40 -0800 | [diff] [blame] | 58 | |
| 59 | struct xt_policy_spec match; |
| 60 | struct xt_policy_spec invert; |
| 61 | }; |
| 62 | |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 63 | struct xt_policy_info { |
Patrick McHardy | c4b8851 | 2006-03-20 18:03:40 -0800 | [diff] [blame] | 64 | struct xt_policy_elem pol[XT_POLICY_MAX_ELEM]; |
Arnd Bergmann | 60c195c | 2009-02-26 00:51:43 +0100 | [diff] [blame] | 65 | __u16 flags; |
| 66 | __u16 len; |
Patrick McHardy | c4b8851 | 2006-03-20 18:03:40 -0800 | [diff] [blame] | 67 | }; |
| 68 | |
| 69 | #endif /* _XT_POLICY_H */ |