]>
Commit | Line | Data |
---|---|---|
14c0b97d TG |
1 | #ifndef __LINUX_FIB_RULES_H |
2 | #define __LINUX_FIB_RULES_H | |
3 | ||
4 | #include <linux/types.h> | |
5 | #include <linux/rtnetlink.h> | |
6 | ||
7 | /* rule is permanent, and cannot be deleted */ | |
29f6af77 YH |
8 | #define FIB_RULE_PERMANENT 0x00000001 |
9 | #define FIB_RULE_INVERT 0x00000002 | |
10 | #define FIB_RULE_UNRESOLVED 0x00000004 | |
491deb24 PM |
11 | #define FIB_RULE_IIF_DETACHED 0x00000008 |
12 | #define FIB_RULE_DEV_DETACHED FIB_RULE_IIF_DETACHED | |
1b038a5e | 13 | #define FIB_RULE_OIF_DETACHED 0x00000010 |
29f6af77 YH |
14 | |
15 | /* try to find source address in routing lookups */ | |
16 | #define FIB_RULE_FIND_SADDR 0x00010000 | |
14c0b97d | 17 | |
0f87b1dd PM |
18 | /* fib_rules families. values up to 127 are reserved for real address |
19 | * families, values above 128 may be used arbitrarily. | |
20 | */ | |
21 | #define FIB_RULES_IPV4 AF_INET | |
22 | #define FIB_RULES_IPV6 AF_INET6 | |
23 | #define FIB_RULES_DECNET AF_DECnet | |
24 | ||
d94d9fee | 25 | struct fib_rule_hdr { |
14c0b97d TG |
26 | __u8 family; |
27 | __u8 dst_len; | |
28 | __u8 src_len; | |
29 | __u8 tos; | |
30 | ||
31 | __u8 table; | |
32 | __u8 res1; /* reserved */ | |
33 | __u8 res2; /* reserved */ | |
34 | __u8 action; | |
35 | ||
36 | __u32 flags; | |
37 | }; | |
38 | ||
d94d9fee | 39 | enum { |
14c0b97d TG |
40 | FRA_UNSPEC, |
41 | FRA_DST, /* destination address */ | |
42 | FRA_SRC, /* source address */ | |
491deb24 PM |
43 | FRA_IIFNAME, /* interface name */ |
44 | #define FRA_IFNAME FRA_IIFNAME | |
0947c9fe | 45 | FRA_GOTO, /* target to jump to (FR_ACT_GOTO) */ |
14c0b97d TG |
46 | FRA_UNUSED2, |
47 | FRA_PRIORITY, /* priority/preference */ | |
48 | FRA_UNUSED3, | |
49 | FRA_UNUSED4, | |
50 | FRA_UNUSED5, | |
b8964ed9 | 51 | FRA_FWMARK, /* mark */ |
14c0b97d | 52 | FRA_FLOW, /* flow/class id */ |
9e762a4a PM |
53 | FRA_UNUSED6, |
54 | FRA_UNUSED7, | |
55 | FRA_UNUSED8, | |
56 | FRA_TABLE, /* Extended table id */ | |
bbfb39cb | 57 | FRA_FWMASK, /* mask for netfilter mark */ |
1b038a5e | 58 | FRA_OIFNAME, |
14c0b97d TG |
59 | __FRA_MAX |
60 | }; | |
61 | ||
62 | #define FRA_MAX (__FRA_MAX - 1) | |
63 | ||
d94d9fee | 64 | enum { |
14c0b97d TG |
65 | FR_ACT_UNSPEC, |
66 | FR_ACT_TO_TBL, /* Pass to fixed table */ | |
0947c9fe | 67 | FR_ACT_GOTO, /* Jump to another rule */ |
fa0b2d1d | 68 | FR_ACT_NOP, /* No operation */ |
14c0b97d TG |
69 | FR_ACT_RES3, |
70 | FR_ACT_RES4, | |
71 | FR_ACT_BLACKHOLE, /* Drop without notification */ | |
72 | FR_ACT_UNREACHABLE, /* Drop with ENETUNREACH */ | |
73 | FR_ACT_PROHIBIT, /* Drop with EACCES */ | |
74 | __FR_ACT_MAX, | |
75 | }; | |
76 | ||
77 | #define FR_ACT_MAX (__FR_ACT_MAX - 1) | |
78 | ||
79 | #endif |