]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - include/net/fib_rules.h
net 03/05: fib_rules: add oif classification
[net-next-2.6.git] / include / net / fib_rules.h
index ca4b2e840078627befec9069f7bdc972778fe7b5..d4e875a58f8b5d99dcf5af95de9e5a103d818b90 100644 (file)
@@ -7,12 +7,11 @@
 #include <net/flow.h>
 #include <net/rtnetlink.h>
 
-struct fib_rule
-{
+struct fib_rule {
        struct list_head        list;
        atomic_t                refcnt;
-       int                     ifindex;
-       char                    ifname[IFNAMSIZ];
+       int                     iifindex;
+       int                     oifindex;
        u32                     mark;
        u32                     mark_mask;
        u32                     pref;
@@ -21,19 +20,19 @@ struct fib_rule
        u8                      action;
        u32                     target;
        struct fib_rule *       ctarget;
+       char                    iifname[IFNAMSIZ];
+       char                    oifname[IFNAMSIZ];
        struct rcu_head         rcu;
        struct net *            fr_net;
 };
 
-struct fib_lookup_arg
-{
+struct fib_lookup_arg {
        void                    *lookup_ptr;
        void                    *result;
        struct fib_rule         *rule;
 };
 
-struct fib_rules_ops
-{
+struct fib_rules_ops {
        int                     family;
        struct list_head        list;
        int                     rule_size;
@@ -70,7 +69,8 @@ struct fib_rules_ops
 };
 
 #define FRA_GENERIC_POLICY \
-       [FRA_IFNAME]    = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \
+       [FRA_IIFNAME]   = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \
+       [FRA_OIFNAME]   = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \
        [FRA_PRIORITY]  = { .type = NLA_U32 }, \
        [FRA_FWMARK]    = { .type = NLA_U32 }, \
        [FRA_FWMASK]    = { .type = NLA_U32 }, \