]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - include/net/ip_fib.h
ipv4: fib table algorithm performance improvement
[linux-2.6.git] / include / net / ip_fib.h
index ef91fe924ba42ddf5a0748836726098ec2a95f9a..68fd5ebd0949874aa675556504f5fa7df4b723e8 100644 (file)
@@ -144,18 +144,21 @@ struct fib_table {
        struct hlist_node tb_hlist;
        u32             tb_id;
        int             tb_default;
-       int             (*tb_lookup)(struct fib_table *tb, const struct flowi *flp, struct fib_result *res);
-       int             (*tb_insert)(struct fib_table *, struct fib_config *);
-       int             (*tb_delete)(struct fib_table *, struct fib_config *);
-       int             (*tb_dump)(struct fib_table *table, struct sk_buff *skb,
-                                    struct netlink_callback *cb);
-       int             (*tb_flush)(struct fib_table *table);
-       void            (*tb_select_default)(struct fib_table *table,
-                                            const struct flowi *flp, struct fib_result *res);
-
        unsigned char   tb_data[0];
 };
 
+extern int fib_table_lookup(struct fib_table *tb, const struct flowi *flp,
+                           struct fib_result *res);
+extern int fib_table_insert(struct fib_table *, struct fib_config *);
+extern int fib_table_delete(struct fib_table *, struct fib_config *);
+extern int fib_table_dump(struct fib_table *table, struct sk_buff *skb,
+                         struct netlink_callback *cb);
+extern int fib_table_flush(struct fib_table *table);
+extern void fib_table_select_default(struct fib_table *table,
+                                    const struct flowi *flp,
+                                    struct fib_result *res);
+
+
 #ifndef CONFIG_IP_MULTIPLE_TABLES
 
 #define TABLE_LOCAL_INDEX      0
@@ -182,11 +185,11 @@ static inline int fib_lookup(struct net *net, const struct flowi *flp,
        struct fib_table *table;
 
        table = fib_get_table(net, RT_TABLE_LOCAL);
-       if (!table->tb_lookup(table, flp, res))
+       if (!fib_table_lookup(table, flp, res))
                return 0;
 
        table = fib_get_table(net, RT_TABLE_MAIN);
-       if (!table->tb_lookup(table, flp, res))
+       if (!fib_table_lookup(table, flp, res))
                return 0;
        return -ENETUNREACH;
 }