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 */ |
YOSHIFUJI Hideaki | 29f6af7 | 2007-04-06 11:45:39 -0700 | [diff] [blame] | 8 | #define FIB_RULE_PERMANENT 0x00000001 |
| 9 | #define FIB_RULE_INVERT 0x00000002 |
| 10 | #define FIB_RULE_UNRESOLVED 0x00000004 |
Patrick McHardy | 491deb2 | 2009-12-03 01:25:54 +0000 | [diff] [blame] | 11 | #define FIB_RULE_IIF_DETACHED 0x00000008 |
| 12 | #define FIB_RULE_DEV_DETACHED FIB_RULE_IIF_DETACHED |
Patrick McHardy | 1b038a5 | 2009-12-03 01:25:56 +0000 | [diff] [blame] | 13 | #define FIB_RULE_OIF_DETACHED 0x00000010 |
YOSHIFUJI Hideaki | 29f6af7 | 2007-04-06 11:45:39 -0700 | [diff] [blame] | 14 | |
| 15 | /* try to find source address in routing lookups */ |
| 16 | #define FIB_RULE_FIND_SADDR 0x00010000 |
Thomas Graf | 14c0b97 | 2006-08-04 03:38:38 -0700 | [diff] [blame] | 17 | |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 18 | struct fib_rule_hdr { |
Thomas Graf | 14c0b97 | 2006-08-04 03:38:38 -0700 | [diff] [blame] | 19 | __u8 family; |
| 20 | __u8 dst_len; |
| 21 | __u8 src_len; |
| 22 | __u8 tos; |
| 23 | |
| 24 | __u8 table; |
| 25 | __u8 res1; /* reserved */ |
| 26 | __u8 res2; /* reserved */ |
| 27 | __u8 action; |
| 28 | |
| 29 | __u32 flags; |
| 30 | }; |
| 31 | |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 32 | enum { |
Thomas Graf | 14c0b97 | 2006-08-04 03:38:38 -0700 | [diff] [blame] | 33 | FRA_UNSPEC, |
| 34 | FRA_DST, /* destination address */ |
| 35 | FRA_SRC, /* source address */ |
Patrick McHardy | 491deb2 | 2009-12-03 01:25:54 +0000 | [diff] [blame] | 36 | FRA_IIFNAME, /* interface name */ |
| 37 | #define FRA_IFNAME FRA_IIFNAME |
Thomas Graf | 0947c9fe | 2007-03-26 17:14:15 -0700 | [diff] [blame] | 38 | FRA_GOTO, /* target to jump to (FR_ACT_GOTO) */ |
Thomas Graf | 14c0b97 | 2006-08-04 03:38:38 -0700 | [diff] [blame] | 39 | FRA_UNUSED2, |
| 40 | FRA_PRIORITY, /* priority/preference */ |
| 41 | FRA_UNUSED3, |
| 42 | FRA_UNUSED4, |
| 43 | FRA_UNUSED5, |
Thomas Graf | b8964ed | 2006-11-09 15:22:18 -0800 | [diff] [blame] | 44 | FRA_FWMARK, /* mark */ |
Thomas Graf | 14c0b97 | 2006-08-04 03:38:38 -0700 | [diff] [blame] | 45 | FRA_FLOW, /* flow/class id */ |
Patrick McHardy | 9e762a4 | 2006-08-10 23:09:48 -0700 | [diff] [blame] | 46 | FRA_UNUSED6, |
| 47 | FRA_UNUSED7, |
| 48 | FRA_UNUSED8, |
| 49 | FRA_TABLE, /* Extended table id */ |
Patrick McHardy | bbfb39c | 2006-08-25 16:10:14 -0700 | [diff] [blame] | 50 | FRA_FWMASK, /* mask for netfilter mark */ |
Patrick McHardy | 1b038a5 | 2009-12-03 01:25:56 +0000 | [diff] [blame] | 51 | FRA_OIFNAME, |
Thomas Graf | 14c0b97 | 2006-08-04 03:38:38 -0700 | [diff] [blame] | 52 | __FRA_MAX |
| 53 | }; |
| 54 | |
| 55 | #define FRA_MAX (__FRA_MAX - 1) |
| 56 | |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 57 | enum { |
Thomas Graf | 14c0b97 | 2006-08-04 03:38:38 -0700 | [diff] [blame] | 58 | FR_ACT_UNSPEC, |
| 59 | FR_ACT_TO_TBL, /* Pass to fixed table */ |
Thomas Graf | 0947c9fe | 2007-03-26 17:14:15 -0700 | [diff] [blame] | 60 | FR_ACT_GOTO, /* Jump to another rule */ |
Thomas Graf | fa0b2d1 | 2007-03-26 17:38:53 -0700 | [diff] [blame] | 61 | FR_ACT_NOP, /* No operation */ |
Thomas Graf | 14c0b97 | 2006-08-04 03:38:38 -0700 | [diff] [blame] | 62 | FR_ACT_RES3, |
| 63 | FR_ACT_RES4, |
| 64 | FR_ACT_BLACKHOLE, /* Drop without notification */ |
| 65 | FR_ACT_UNREACHABLE, /* Drop with ENETUNREACH */ |
| 66 | FR_ACT_PROHIBIT, /* Drop with EACCES */ |
| 67 | __FR_ACT_MAX, |
| 68 | }; |
| 69 | |
| 70 | #define FR_ACT_MAX (__FR_ACT_MAX - 1) |
| 71 | |
| 72 | #endif |