blob: c7e5b700bb91e62879fe8b27ff89a63221ca88f1 [file] [log] [blame]
Thomas Graf14c0b972006-08-04 03:38:38 -07001#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 Hideaki29f6af72007-04-06 11:45:39 -07008#define FIB_RULE_PERMANENT 0x00000001
9#define FIB_RULE_INVERT 0x00000002
10#define FIB_RULE_UNRESOLVED 0x00000004
11#define FIB_RULE_DEV_DETACHED 0x00000008
12
13/* try to find source address in routing lookups */
14#define FIB_RULE_FIND_SADDR 0x00010000
Thomas Graf14c0b972006-08-04 03:38:38 -070015
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080016struct fib_rule_hdr {
Thomas Graf14c0b972006-08-04 03:38:38 -070017 __u8 family;
18 __u8 dst_len;
19 __u8 src_len;
20 __u8 tos;
21
22 __u8 table;
23 __u8 res1; /* reserved */
24 __u8 res2; /* reserved */
25 __u8 action;
26
27 __u32 flags;
28};
29
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080030enum {
Thomas Graf14c0b972006-08-04 03:38:38 -070031 FRA_UNSPEC,
32 FRA_DST, /* destination address */
33 FRA_SRC, /* source address */
34 FRA_IFNAME, /* interface name */
Thomas Graf0947c9fe2007-03-26 17:14:15 -070035 FRA_GOTO, /* target to jump to (FR_ACT_GOTO) */
Thomas Graf14c0b972006-08-04 03:38:38 -070036 FRA_UNUSED2,
37 FRA_PRIORITY, /* priority/preference */
38 FRA_UNUSED3,
39 FRA_UNUSED4,
40 FRA_UNUSED5,
Thomas Grafb8964ed2006-11-09 15:22:18 -080041 FRA_FWMARK, /* mark */
Thomas Graf14c0b972006-08-04 03:38:38 -070042 FRA_FLOW, /* flow/class id */
Patrick McHardy9e762a42006-08-10 23:09:48 -070043 FRA_UNUSED6,
44 FRA_UNUSED7,
45 FRA_UNUSED8,
46 FRA_TABLE, /* Extended table id */
Patrick McHardybbfb39c2006-08-25 16:10:14 -070047 FRA_FWMASK, /* mask for netfilter mark */
Thomas Graf14c0b972006-08-04 03:38:38 -070048 __FRA_MAX
49};
50
51#define FRA_MAX (__FRA_MAX - 1)
52
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080053enum {
Thomas Graf14c0b972006-08-04 03:38:38 -070054 FR_ACT_UNSPEC,
55 FR_ACT_TO_TBL, /* Pass to fixed table */
Thomas Graf0947c9fe2007-03-26 17:14:15 -070056 FR_ACT_GOTO, /* Jump to another rule */
Thomas Graffa0b2d12007-03-26 17:38:53 -070057 FR_ACT_NOP, /* No operation */
Thomas Graf14c0b972006-08-04 03:38:38 -070058 FR_ACT_RES3,
59 FR_ACT_RES4,
60 FR_ACT_BLACKHOLE, /* Drop without notification */
61 FR_ACT_UNREACHABLE, /* Drop with ENETUNREACH */
62 FR_ACT_PROHIBIT, /* Drop with EACCES */
63 __FR_ACT_MAX,
64};
65
66#define FR_ACT_MAX (__FR_ACT_MAX - 1)
67
68#endif