aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2009-12-02 20:25:56 -0500
committerDavid S. Miller <davem@davemloft.net>2009-12-03 15:14:36 -0500
commit1b038a5e60c7812f19818e8a5df96d029e49c38f (patch)
treeeea09368802178a64429beb656a03a2cc71e2f42 /include
parent491deb24bf5bf7124141287aaf02c3219783ceab (diff)
net 03/05: fib_rules: add oif classification
commit 68144d350f4f6c348659c825cde6a82b34c27a91 Author: Patrick McHardy <kaber@trash.net> Date: Thu Dec 3 12:05:25 2009 +0100 net: fib_rules: add oif classification Support routing table lookup based on the flow's oif. This is useful to classify packets originating from sockets bound to interfaces differently. The route cache already includes the oif and needs no changes. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/fib_rules.h2
-rw-r--r--include/net/fib_rules.h3
2 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/fib_rules.h b/include/linux/fib_rules.h
index 7e11bb2fa65..51da65b68b8 100644
--- a/include/linux/fib_rules.h
+++ b/include/linux/fib_rules.h
@@ -10,6 +10,7 @@
10#define FIB_RULE_UNRESOLVED 0x00000004 10#define FIB_RULE_UNRESOLVED 0x00000004
11#define FIB_RULE_IIF_DETACHED 0x00000008 11#define FIB_RULE_IIF_DETACHED 0x00000008
12#define FIB_RULE_DEV_DETACHED FIB_RULE_IIF_DETACHED 12#define FIB_RULE_DEV_DETACHED FIB_RULE_IIF_DETACHED
13#define FIB_RULE_OIF_DETACHED 0x00000010
13 14
14/* try to find source address in routing lookups */ 15/* try to find source address in routing lookups */
15#define FIB_RULE_FIND_SADDR 0x00010000 16#define FIB_RULE_FIND_SADDR 0x00010000
@@ -47,6 +48,7 @@ enum {
47 FRA_UNUSED8, 48 FRA_UNUSED8,
48 FRA_TABLE, /* Extended table id */ 49 FRA_TABLE, /* Extended table id */
49 FRA_FWMASK, /* mask for netfilter mark */ 50 FRA_FWMASK, /* mask for netfilter mark */
51 FRA_OIFNAME,
50 __FRA_MAX 52 __FRA_MAX
51}; 53};
52 54
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index 62bebcb2a51..d4e875a58f8 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -11,6 +11,7 @@ struct fib_rule {
11 struct list_head list; 11 struct list_head list;
12 atomic_t refcnt; 12 atomic_t refcnt;
13 int iifindex; 13 int iifindex;
14 int oifindex;
14 u32 mark; 15 u32 mark;
15 u32 mark_mask; 16 u32 mark_mask;
16 u32 pref; 17 u32 pref;
@@ -20,6 +21,7 @@ struct fib_rule {
20 u32 target; 21 u32 target;
21 struct fib_rule * ctarget; 22 struct fib_rule * ctarget;
22 char iifname[IFNAMSIZ]; 23 char iifname[IFNAMSIZ];
24 char oifname[IFNAMSIZ];
23 struct rcu_head rcu; 25 struct rcu_head rcu;
24 struct net * fr_net; 26 struct net * fr_net;
25}; 27};
@@ -68,6 +70,7 @@ struct fib_rules_ops {
68 70
69#define FRA_GENERIC_POLICY \ 71#define FRA_GENERIC_POLICY \
70 [FRA_IIFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \ 72 [FRA_IIFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \
73 [FRA_OIFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \
71 [FRA_PRIORITY] = { .type = NLA_U32 }, \ 74 [FRA_PRIORITY] = { .type = NLA_U32 }, \
72 [FRA_FWMARK] = { .type = NLA_U32 }, \ 75 [FRA_FWMARK] = { .type = NLA_U32 }, \
73 [FRA_FWMASK] = { .type = NLA_U32 }, \ 76 [FRA_FWMASK] = { .type = NLA_U32 }, \