xt_policy.h revision e37d45ce390c2f5a7f1e64742b9100ecef0def54
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
8enum 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
15enum xt_policy_modes {
16	XT_POLICY_MODE_TRANSPORT,
17	XT_POLICY_MODE_TUNNEL
18};
19
20struct 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#ifndef __KERNEL__
30union xt_policy_addr {
31	struct in_addr	a4;
32	struct in6_addr	a6;
33};
34#endif
35
36struct xt_policy_elem {
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	};
54	__be32			spi;
55	__u32		reqid;
56	__u8		proto;
57	__u8		mode;
58
59	struct xt_policy_spec	match;
60	struct xt_policy_spec	invert;
61};
62
63struct xt_policy_info {
64	struct xt_policy_elem pol[XT_POLICY_MAX_ELEM];
65	__u16 flags;
66	__u16 len;
67};
68
69#endif /* _XT_POLICY_H */
70