]> git.hungrycats.org Git - linux/commitdiff
[IPV4]: Define fib_alias in new header fib_lookup.h
authorDavid S. Miller <davem@nuts.davemloft.net>
Tue, 28 Sep 2004 13:49:52 +0000 (06:49 -0700)
committerDavid S. Miller <davem@nuts.davemloft.net>
Tue, 28 Sep 2004 13:49:52 +0000 (06:49 -0700)
Also s/FN_S_ACCESSED/FA_S_ACCESSED/

Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_hash.c
net/ipv4/fib_lookup.h [new file with mode: 0644]

index 723ed400d165e89218aa3dd5962948d0a2201b65..f53995dccf9da85758cc17e35ec16c9d97ea6d64 100644 (file)
@@ -43,6 +43,8 @@
 #include <net/sock.h>
 #include <net/ip_fib.h>
 
+#include "fib_lookup.h"
+
 static kmem_cache_t *fn_hash_kmem;
 static kmem_cache_t *fn_alias_kmem;
 
@@ -52,17 +54,6 @@ struct fib_node {
        u32                     fn_key;
 };
 
-struct fib_alias {
-       struct list_head        fa_list;
-       struct fib_info         *fa_info;
-       u8                      fa_tos;
-       u8                      fa_type;
-       u8                      fa_scope;
-       u8                      fa_state;
-};
-
-#define FN_S_ACCESSED  1
-
 struct fn_zone {
        struct fn_zone          *fz_next;       /* Next not empty zone  */
        struct hlist_head       *fz_hash;       /* Hash table pointer   */
@@ -277,7 +268,7 @@ fn_hash_lookup(struct fib_table *tb, const struct flowi *flp, struct fib_result
                                if (fa->fa_scope < flp->fl4_scope)
                                        continue;
 
-                               fa->fa_state |= FN_S_ACCESSED;
+                               fa->fa_state |= FA_S_ACCESSED;
 
                                err = fib_semantic_match(fa->fa_type,
                                                         fa->fa_info,
@@ -358,7 +349,7 @@ fn_hash_select_default(struct fib_table *tb, const struct flowi *flp, struct fib
                        if (!next_fi->fib_nh[0].nh_gw ||
                            next_fi->fib_nh[0].nh_scope != RT_SCOPE_LINK)
                                continue;
-                       fa->fa_state |= FN_S_ACCESSED;
+                       fa->fa_state |= FA_S_ACCESSED;
 
                        if (fi == NULL) {
                                if (next_fi != res->fi)
@@ -521,11 +512,11 @@ fn_hash_insert(struct fib_table *tb, struct rtmsg *r, struct kern_rta *rta,
                        fa->fa_type = type;
                        fa->fa_scope = r->rtm_scope;
                        state = fa->fa_state;
-                       fa->fa_state &= ~FN_S_ACCESSED;
+                       fa->fa_state &= ~FA_S_ACCESSED;
                        write_unlock_bh(&fib_hash_lock);
 
                        fib_release_info(fi_drop);
-                       if (state & FN_S_ACCESSED)
+                       if (state & FA_S_ACCESSED)
                                rt_cache_flush(-1);
                        return 0;
                }
@@ -669,7 +660,7 @@ fn_hash_delete(struct fib_table *tb, struct rtmsg *r, struct kern_rta *rta,
                }
                write_unlock_bh(&fib_hash_lock);
 
-               if (fa->fa_state & FN_S_ACCESSED)
+               if (fa->fa_state & FA_S_ACCESSED)
                        rt_cache_flush(-1);
                fn_free_alias(fa);
                if (kill_fn) {
diff --git a/net/ipv4/fib_lookup.h b/net/ipv4/fib_lookup.h
new file mode 100644 (file)
index 0000000..22a4382
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef _FIB_LOOKUP_H
+#define _FIB_LOOKUP_H
+
+#include <linux/types.h>
+#include <linux/list.h>
+#include <net/ip_fib.h>
+
+struct fib_alias {
+       struct list_head        fa_list;
+       struct fib_info         *fa_info;
+       u8                      fa_tos;
+       u8                      fa_type;
+       u8                      fa_scope;
+       u8                      fa_state;
+};
+
+#define FA_S_ACCESSED  0x01
+
+#endif /* _FIB_LOOKUP_H */