Thomas Graf | 14c0b97 | 2006-08-04 03:38:38 -0700 | [diff] [blame] | 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 */ |
| 8 | #define FIB_RULE_PERMANENT 1 |
Thomas Graf | 3dfbcc4 | 2006-11-09 15:23:20 -0800 | [diff] [blame] | 9 | #define FIB_RULE_INVERT 2 |
Thomas Graf | 14c0b97 | 2006-08-04 03:38:38 -0700 | [diff] [blame] | 10 | |
| 11 | struct fib_rule_hdr |
| 12 | { |
| 13 | __u8 family; |
| 14 | __u8 dst_len; |
| 15 | __u8 src_len; |
| 16 | __u8 tos; |
| 17 | |
| 18 | __u8 table; |
| 19 | __u8 res1; /* reserved */ |
| 20 | __u8 res2; /* reserved */ |
| 21 | __u8 action; |
| 22 | |
| 23 | __u32 flags; |
| 24 | }; |
| 25 | |
| 26 | enum |
| 27 | { |
| 28 | FRA_UNSPEC, |
| 29 | FRA_DST, /* destination address */ |
| 30 | FRA_SRC, /* source address */ |
| 31 | FRA_IFNAME, /* interface name */ |
| 32 | FRA_UNUSED1, |
| 33 | FRA_UNUSED2, |
| 34 | FRA_PRIORITY, /* priority/preference */ |
| 35 | FRA_UNUSED3, |
| 36 | FRA_UNUSED4, |
| 37 | FRA_UNUSED5, |
Thomas Graf | b8964ed | 2006-11-09 15:22:18 -0800 | [diff] [blame] | 38 | FRA_FWMARK, /* mark */ |
Thomas Graf | 14c0b97 | 2006-08-04 03:38:38 -0700 | [diff] [blame] | 39 | FRA_FLOW, /* flow/class id */ |
Patrick McHardy | 9e762a4 | 2006-08-10 23:09:48 -0700 | [diff] [blame] | 40 | FRA_UNUSED6, |
| 41 | FRA_UNUSED7, |
| 42 | FRA_UNUSED8, |
| 43 | FRA_TABLE, /* Extended table id */ |
Patrick McHardy | bbfb39c | 2006-08-25 16:10:14 -0700 | [diff] [blame] | 44 | FRA_FWMASK, /* mask for netfilter mark */ |
Thomas Graf | 14c0b97 | 2006-08-04 03:38:38 -0700 | [diff] [blame] | 45 | __FRA_MAX |
| 46 | }; |
| 47 | |
| 48 | #define FRA_MAX (__FRA_MAX - 1) |
| 49 | |
| 50 | enum |
| 51 | { |
| 52 | FR_ACT_UNSPEC, |
| 53 | FR_ACT_TO_TBL, /* Pass to fixed table */ |
| 54 | FR_ACT_RES1, |
| 55 | FR_ACT_RES2, |
| 56 | FR_ACT_RES3, |
| 57 | FR_ACT_RES4, |
| 58 | FR_ACT_BLACKHOLE, /* Drop without notification */ |
| 59 | FR_ACT_UNREACHABLE, /* Drop with ENETUNREACH */ |
| 60 | FR_ACT_PROHIBIT, /* Drop with EACCES */ |
| 61 | __FR_ACT_MAX, |
| 62 | }; |
| 63 | |
| 64 | #define FR_ACT_MAX (__FR_ACT_MAX - 1) |
| 65 | |
| 66 | #endif |