• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _XT_POLICY_H
2 #define _XT_POLICY_H
3 
4 #include <linux/types.h>
5 
6 #define XT_POLICY_MAX_ELEM	4
7 
8 enum xt_policy_flags {
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 
15 enum xt_policy_modes {
16 	XT_POLICY_MODE_TRANSPORT,
17 	XT_POLICY_MODE_TUNNEL
18 };
19 
20 struct xt_policy_spec {
21 	__u8	saddr:1,
22 			daddr:1,
23 			proto:1,
24 			mode:1,
25 			spi:1,
26 			reqid:1;
27 };
28 
29 union xt_policy_addr {
30 	struct in_addr	a4;
31 	struct in6_addr	a6;
32 };
33 
34 struct xt_policy_elem {
35 	union {
36 		struct {
37 			union xt_policy_addr saddr;
38 			union xt_policy_addr smask;
39 			union xt_policy_addr daddr;
40 			union xt_policy_addr dmask;
41 		};
42 	};
43 	__be32			spi;
44 	__u32		reqid;
45 	__u8		proto;
46 	__u8		mode;
47 
48 	struct xt_policy_spec	match;
49 	struct xt_policy_spec	invert;
50 };
51 
52 struct xt_policy_info {
53 	struct xt_policy_elem pol[XT_POLICY_MAX_ELEM];
54 	__u16 flags;
55 	__u16 len;
56 };
57 
58 #endif /* _XT_POLICY_H */
59