gss_krb5: add remaining pieces to enable AES encryption support
[safe/jmp/linux-2.6] / net / ipv4 / fib_hash.c
index ded8c44..4ed7e0d 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/skbuff.h>
 #include <linux/netlink.h>
 #include <linux/init.h>
+#include <linux/slab.h>
 
 #include <net/net_namespace.h>
 #include <net/ip.h>
@@ -242,8 +243,8 @@ fn_new_zone(struct fn_hash *table, int z)
        return fz;
 }
 
-static int
-fn_hash_lookup(struct fib_table *tb, const struct flowi *flp, struct fib_result *res)
+int fib_table_lookup(struct fib_table *tb,
+                    const struct flowi *flp, struct fib_result *res)
 {
        int err;
        struct fn_zone *fz;
@@ -263,7 +264,6 @@ fn_hash_lookup(struct fib_table *tb, const struct flowi *flp, struct fib_result
 
                        err = fib_semantic_match(&f->fn_alias,
                                                 flp, res,
-                                                f->fn_key, fz->fz_mask,
                                                 fz->fz_order);
                        if (err <= 0)
                                goto out;
@@ -275,8 +275,8 @@ out:
        return err;
 }
 
-static void
-fn_hash_select_default(struct fib_table *tb, const struct flowi *flp, struct fib_result *res)
+void fib_table_select_default(struct fib_table *tb,
+                             const struct flowi *flp, struct fib_result *res)
 {
        int order, last_idx;
        struct hlist_node *node;
@@ -367,7 +367,7 @@ static struct fib_node *fib_find_node(struct fn_zone *fz, __be32 key)
        return NULL;
 }
 
-static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg)
+int fib_table_insert(struct fib_table *tb, struct fib_config *cfg)
 {
        struct fn_hash *table = (struct fn_hash *) tb->tb_data;
        struct fib_node *new_f = NULL;
@@ -545,8 +545,7 @@ out:
        return err;
 }
 
-
-static int fn_hash_delete(struct fib_table *tb, struct fib_config *cfg)
+int fib_table_delete(struct fib_table *tb, struct fib_config *cfg)
 {
        struct fn_hash *table = (struct fn_hash *)tb->tb_data;
        struct fib_node *f;
@@ -663,7 +662,7 @@ static int fn_flush_list(struct fn_zone *fz, int idx)
        return found;
 }
 
-static int fn_hash_flush(struct fib_table *tb)
+int fib_table_flush(struct fib_table *tb)
 {
        struct fn_hash *table = (struct fn_hash *) tb->tb_data;
        struct fn_zone *fz;
@@ -744,7 +743,8 @@ fn_hash_dump_zone(struct sk_buff *skb, struct netlink_callback *cb,
        return skb->len;
 }
 
-static int fn_hash_dump(struct fib_table *tb, struct sk_buff *skb, struct netlink_callback *cb)
+int fib_table_dump(struct fib_table *tb, struct sk_buff *skb,
+                  struct netlink_callback *cb)
 {
        int m, s_m;
        struct fn_zone *fz;
@@ -788,12 +788,7 @@ struct fib_table *fib_hash_table(u32 id)
 
        tb->tb_id = id;
        tb->tb_default = -1;
-       tb->tb_lookup = fn_hash_lookup;
-       tb->tb_insert = fn_hash_insert;
-       tb->tb_delete = fn_hash_delete;
-       tb->tb_flush = fn_hash_flush;
-       tb->tb_select_default = fn_hash_select_default;
-       tb->tb_dump = fn_hash_dump;
+
        memset(tb->tb_data, 0, sizeof(struct fn_hash));
        return tb;
 }