File: xt_policy.h

package info (click to toggle)
linux-2.6 2.6.18.dfsg.1-26etch2
  • links: PTS
  • area: main
  • in suites: etch
  • size: 289,112 kB
  • ctags: 831,064
  • sloc: ansic: 4,700,345; asm: 205,595; makefile: 13,019; perl: 3,208; python: 2,735; yacc: 2,632; sh: 2,313; cpp: 2,107; lex: 1,510; lisp: 218; awk: 99; pascal: 41
file content (58 lines) | stat: -rw-r--r-- 877 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef _XT_POLICY_H
#define _XT_POLICY_H

#define XT_POLICY_MAX_ELEM	4

enum xt_policy_flags
{
	XT_POLICY_MATCH_IN	= 0x1,
	XT_POLICY_MATCH_OUT	= 0x2,
	XT_POLICY_MATCH_NONE	= 0x4,
	XT_POLICY_MATCH_STRICT	= 0x8,
};

enum xt_policy_modes
{
	XT_POLICY_MODE_TRANSPORT,
	XT_POLICY_MODE_TUNNEL
};

struct xt_policy_spec
{
	u_int8_t	saddr:1,
			daddr:1,
			proto:1,
			mode:1,
			spi:1,
			reqid:1;
};

union xt_policy_addr
{
	struct in_addr	a4;
	struct in6_addr	a6;
};

struct xt_policy_elem
{
	union xt_policy_addr	saddr;
	union xt_policy_addr	smask;
	union xt_policy_addr	daddr;
	union xt_policy_addr	dmask;
	u_int32_t		spi;
	u_int32_t		reqid;
	u_int8_t		proto;
	u_int8_t		mode;

	struct xt_policy_spec	match;
	struct xt_policy_spec	invert;
};

struct xt_policy_info
{
	struct xt_policy_elem pol[XT_POLICY_MAX_ELEM];
	u_int16_t flags;
	u_int16_t len;
};

#endif /* _XT_POLICY_H */