Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
[safe/jmp/linux-2.6] / include / net / fib_rules.h
index 22fb323..e8923bc 100644 (file)
@@ -2,6 +2,7 @@
 #define __NET_FIB_RULES_H
 
 #include <linux/types.h>
+#include <linux/slab.h>
 #include <linux/netdevice.h>
 #include <linux/fib_rules.h>
 #include <net/flow.h>
@@ -10,7 +11,8 @@
 struct fib_rule {
        struct list_head        list;
        atomic_t                refcnt;
-       int                     ifindex;
+       int                     iifindex;
+       int                     oifindex;
        u32                     mark;
        u32                     mark_mask;
        u32                     pref;
@@ -19,7 +21,8 @@ struct fib_rule {
        u8                      action;
        u32                     target;
        struct fib_rule *       ctarget;
-       char                    ifname[IFNAMSIZ];
+       char                    iifname[IFNAMSIZ];
+       char                    oifname[IFNAMSIZ];
        struct rcu_head         rcu;
        struct net *            fr_net;
 };
@@ -64,10 +67,12 @@ struct fib_rules_ops {
        struct list_head        rules_list;
        struct module           *owner;
        struct net              *fro_net;
+       struct rcu_head         rcu;
 };
 
 #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 }, \
@@ -99,7 +104,7 @@ static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla)
        return frh->table;
 }
 
-extern int fib_rules_register(struct fib_rules_ops *);
+extern struct fib_rules_ops *fib_rules_register(const struct fib_rules_ops *, struct net *);
 extern void fib_rules_unregister(struct fib_rules_ops *);
 extern void                     fib_rules_cleanup_ops(struct fib_rules_ops *);
 
@@ -109,4 +114,5 @@ extern int                  fib_rules_lookup(struct fib_rules_ops *,
 extern int                     fib_default_rule_add(struct fib_rules_ops *,
                                                     u32 pref, u32 table,
                                                     u32 flags);
+extern u32                     fib_default_rule_pref(struct fib_rules_ops *ops);
 #endif