2006-03-21 02:03:40 +00:00
|
|
|
#ifndef _XT_POLICY_H
|
|
|
|
#define _XT_POLICY_H
|
|
|
|
|
2009-02-25 23:51:43 +00:00
|
|
|
#include <linux/types.h>
|
|
|
|
|
2006-03-21 02:03:40 +00:00
|
|
|
#define XT_POLICY_MAX_ELEM 4
|
|
|
|
|
2009-11-04 17:50:58 +00:00
|
|
|
enum xt_policy_flags {
|
2006-03-21 02:03:40 +00:00
|
|
|
XT_POLICY_MATCH_IN = 0x1,
|
|
|
|
XT_POLICY_MATCH_OUT = 0x2,
|
|
|
|
XT_POLICY_MATCH_NONE = 0x4,
|
|
|
|
XT_POLICY_MATCH_STRICT = 0x8,
|
|
|
|
};
|
|
|
|
|
2009-11-04 17:50:58 +00:00
|
|
|
enum xt_policy_modes {
|
2006-03-21 02:03:40 +00:00
|
|
|
XT_POLICY_MODE_TRANSPORT,
|
|
|
|
XT_POLICY_MODE_TUNNEL
|
|
|
|
};
|
|
|
|
|
2009-11-04 17:50:58 +00:00
|
|
|
struct xt_policy_spec {
|
2009-02-25 23:51:43 +00:00
|
|
|
__u8 saddr:1,
|
2006-03-21 02:03:40 +00:00
|
|
|
daddr:1,
|
|
|
|
proto:1,
|
|
|
|
mode:1,
|
|
|
|
spi:1,
|
|
|
|
reqid:1;
|
|
|
|
};
|
|
|
|
|
2008-01-15 07:42:06 +00:00
|
|
|
#ifndef __KERNEL__
|
2009-11-04 17:50:58 +00:00
|
|
|
union xt_policy_addr {
|
2006-03-21 02:03:40 +00:00
|
|
|
struct in_addr a4;
|
|
|
|
struct in6_addr a6;
|
|
|
|
};
|
2008-01-15 07:42:06 +00:00
|
|
|
#endif
|
2006-03-21 02:03:40 +00:00
|
|
|
|
2009-11-04 17:50:58 +00:00
|
|
|
struct xt_policy_elem {
|
2008-01-15 07:42:06 +00:00
|
|
|
union {
|
|
|
|
#ifdef __KERNEL__
|
|
|
|
struct {
|
|
|
|
union nf_inet_addr saddr;
|
|
|
|
union nf_inet_addr smask;
|
|
|
|
union nf_inet_addr daddr;
|
|
|
|
union nf_inet_addr dmask;
|
|
|
|
};
|
|
|
|
#else
|
|
|
|
struct {
|
|
|
|
union xt_policy_addr saddr;
|
|
|
|
union xt_policy_addr smask;
|
|
|
|
union xt_policy_addr daddr;
|
|
|
|
union xt_policy_addr dmask;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
};
|
2006-11-08 08:26:51 +00:00
|
|
|
__be32 spi;
|
2009-02-25 23:51:43 +00:00
|
|
|
__u32 reqid;
|
|
|
|
__u8 proto;
|
|
|
|
__u8 mode;
|
2006-03-21 02:03:40 +00:00
|
|
|
|
|
|
|
struct xt_policy_spec match;
|
|
|
|
struct xt_policy_spec invert;
|
|
|
|
};
|
|
|
|
|
2009-11-04 17:50:58 +00:00
|
|
|
struct xt_policy_info {
|
2006-03-21 02:03:40 +00:00
|
|
|
struct xt_policy_elem pol[XT_POLICY_MAX_ELEM];
|
2009-02-25 23:51:43 +00:00
|
|
|
__u16 flags;
|
|
|
|
__u16 len;
|
2006-03-21 02:03:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _XT_POLICY_H */
|