blob: 51da65b68b8501cb2d25fe0064c2c6ff65e3d4e6 [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
Patrick McHardy491deb24b2009-12-03 01:25:54 +000011#define FIB_RULE_IIF_DETACHED 0x00000008
12#define FIB_RULE_DEV_DETACHED FIB_RULE_IIF_DETACHED
Patrick McHardy1b038a52009-12-03 01:25:56 +000013#define FIB_RULE_OIF_DETACHED 0x00000010
YOSHIFUJI Hideaki29f6af72007-04-06 11:45:39 -070014
15/* try to find source address in routing lookups */
16#define FIB_RULE_FIND_SADDR 0x00010000
Thomas Graf14c0b972006-08-04 03:38:38 -070017
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080018struct fib_rule_hdr {
Thomas Graf14c0b972006-08-04 03:38:38 -070019 __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 Dumazetd94d9fe2009-11-04 09:50:58 -080032enum {
Thomas Graf14c0b972006-08-04 03:38:38 -070033 FRA_UNSPEC,
34 FRA_DST, /* destination address */
35 FRA_SRC, /* source address */
Patrick McHardy491deb24b2009-12-03 01:25:54 +000036 FRA_IIFNAME, /* interface name */
37#define FRA_IFNAME FRA_IIFNAME
Thomas Graf0947c9fe2007-03-26 17:14:15 -070038 FRA_GOTO, /* target to jump to (FR_ACT_GOTO) */
Thomas Graf14c0b972006-08-04 03:38:38 -070039 FRA_UNUSED2,
40 FRA_PRIORITY, /* priority/preference */
41 FRA_UNUSED3,
42 FRA_UNUSED4,
43 FRA_UNUSED5,
Thomas Grafb8964ed2006-11-09 15:22:18 -080044 FRA_FWMARK, /* mark */
Thomas Graf14c0b972006-08-04 03:38:38 -070045 FRA_FLOW, /* flow/class id */
Patrick McHardy9e762a42006-08-10 23:09:48 -070046 FRA_UNUSED6,
47 FRA_UNUSED7,
48 FRA_UNUSED8,
49 FRA_TABLE, /* Extended table id */
Patrick McHardybbfb39c2006-08-25 16:10:14 -070050 FRA_FWMASK, /* mask for netfilter mark */
Patrick McHardy1b038a52009-12-03 01:25:56 +000051 FRA_OIFNAME,
Thomas Graf14c0b972006-08-04 03:38:38 -070052 __FRA_MAX
53};
54
55#define FRA_MAX (__FRA_MAX - 1)
56
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080057enum {
Thomas Graf14c0b972006-08-04 03:38:38 -070058 FR_ACT_UNSPEC,
59 FR_ACT_TO_TBL, /* Pass to fixed table */
Thomas Graf0947c9fe2007-03-26 17:14:15 -070060 FR_ACT_GOTO, /* Jump to another rule */
Thomas Graffa0b2d12007-03-26 17:38:53 -070061 FR_ACT_NOP, /* No operation */
Thomas Graf14c0b972006-08-04 03:38:38 -070062 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