aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fib_rules.h
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2007-03-26 20:14:15 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:28:12 -0400
commit0947c9fe56d9cf7ad0bc3a03ccd30446cde698e4 (patch)
tree10d40d8d536d686b8226907f942b064c4bc59a4b /include/linux/fib_rules.h
parent2f7826c02447480c7c1b5500b34fc783f1ed8145 (diff)
[NET] fib_rules: goto rule action
This patch adds a new rule action FR_ACT_GOTO which allows to skip a set of rules by jumping to another rule. The rule to jump to is specified via the FRA_GOTO attribute which carries a rule preference. Referring to a rule which doesn't exists is explicitely allowed. Such goto rules are marked with the flag FIB_RULE_UNRESOLVED and will act like a rule with a non-matching selector. The rule will become functional as soon as its target is present. The goto action enables performance optimizations by reducing the average number of rules that have to be passed per lookup. Example: 0: from all lookup local 40: not from all to 192.168.23.128 goto 32766 41: from all fwmark 0xa blackhole 42: from all fwmark 0xff blackhole 32766: from all lookup main Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/fib_rules.h')
-rw-r--r--include/linux/fib_rules.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/fib_rules.h b/include/linux/fib_rules.h
index 8270aac2aa5d..ec9c7b1d3e91 100644
--- a/include/linux/fib_rules.h
+++ b/include/linux/fib_rules.h
@@ -7,6 +7,7 @@
7/* rule is permanent, and cannot be deleted */ 7/* rule is permanent, and cannot be deleted */
8#define FIB_RULE_PERMANENT 1 8#define FIB_RULE_PERMANENT 1
9#define FIB_RULE_INVERT 2 9#define FIB_RULE_INVERT 2
10#define FIB_RULE_UNRESOLVED 4
10 11
11struct fib_rule_hdr 12struct fib_rule_hdr
12{ 13{
@@ -29,7 +30,7 @@ enum
29 FRA_DST, /* destination address */ 30 FRA_DST, /* destination address */
30 FRA_SRC, /* source address */ 31 FRA_SRC, /* source address */
31 FRA_IFNAME, /* interface name */ 32 FRA_IFNAME, /* interface name */
32 FRA_UNUSED1, 33 FRA_GOTO, /* target to jump to (FR_ACT_GOTO) */
33 FRA_UNUSED2, 34 FRA_UNUSED2,
34 FRA_PRIORITY, /* priority/preference */ 35 FRA_PRIORITY, /* priority/preference */
35 FRA_UNUSED3, 36 FRA_UNUSED3,
@@ -51,7 +52,7 @@ enum
51{ 52{
52 FR_ACT_UNSPEC, 53 FR_ACT_UNSPEC,
53 FR_ACT_TO_TBL, /* Pass to fixed table */ 54 FR_ACT_TO_TBL, /* Pass to fixed table */
54 FR_ACT_RES1, 55 FR_ACT_GOTO, /* Jump to another rule */
55 FR_ACT_RES2, 56 FR_ACT_RES2,
56 FR_ACT_RES3, 57 FR_ACT_RES3,
57 FR_ACT_RES4, 58 FR_ACT_RES4,