aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet/dn_fib.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2006-08-11 02:11:47 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 17:54:28 -0400
commitabcab268303c22d24fc89fedd35d82271d20f5da (patch)
tree2add5b99164734899d92ad37d89b1ded91c219bf /net/decnet/dn_fib.c
parent1b43af5480c351dbcb2eef478bafe179cbeb6e83 (diff)
[DECNET]: Increase number of possible routing tables to 2^32
Increase the number of possible routing tables to 2^32 by replacing the fixed sized array of pointers by a hash table and replacing iterations over all possible table IDs by hash table walking. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet/dn_fib.c')
-rw-r--r--net/decnet/dn_fib.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c
index fb596373daa8..5ccca3ed53bd 100644
--- a/net/decnet/dn_fib.c
+++ b/net/decnet/dn_fib.c
@@ -532,39 +532,6 @@ int dn_fib_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
532 return -ENOBUFS; 532 return -ENOBUFS;
533} 533}
534 534
535
536int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb)
537{
538 u32 t;
539 u32 s_t;
540 struct dn_fib_table *tb;
541
542 if (NLMSG_PAYLOAD(cb->nlh, 0) >= sizeof(struct rtmsg) &&
543 ((struct rtmsg *)NLMSG_DATA(cb->nlh))->rtm_flags&RTM_F_CLONED)
544 return dn_cache_dump(skb, cb);
545
546 s_t = cb->args[0];
547 if (s_t == 0)
548 s_t = cb->args[0] = RT_MIN_TABLE;
549
550 for(t = s_t; t <= RT_TABLE_MAX; t++) {
551 if (t < s_t)
552 continue;
553 if (t > s_t)
554 memset(&cb->args[1], 0,
555 sizeof(cb->args) - sizeof(cb->args[0]));
556 tb = dn_fib_get_table(t, 0);
557 if (tb == NULL)
558 continue;
559 if (tb->dump(tb, skb, cb) < 0)
560 break;
561 }
562
563 cb->args[0] = t;
564
565 return skb->len;
566}
567
568static void fib_magic(int cmd, int type, __le16 dst, int dst_len, struct dn_ifaddr *ifa) 535static void fib_magic(int cmd, int type, __le16 dst, int dst_len, struct dn_ifaddr *ifa)
569{ 536{
570 struct dn_fib_table *tb; 537 struct dn_fib_table *tb;
@@ -762,22 +729,6 @@ int dn_fib_sync_up(struct net_device *dev)
762 return ret; 729 return ret;
763} 730}
764 731
765void dn_fib_flush(void)
766{
767 int flushed = 0;
768 struct dn_fib_table *tb;
769 u32 id;
770
771 for(id = RT_TABLE_MAX; id > 0; id--) {
772 if ((tb = dn_fib_get_table(id, 0)) == NULL)
773 continue;
774 flushed += tb->flush(tb);
775 }
776
777 if (flushed)
778 dn_rt_cache_flush(-1);
779}
780
781static struct notifier_block dn_fib_dnaddr_notifier = { 732static struct notifier_block dn_fib_dnaddr_notifier = {
782 .notifier_call = dn_fib_dnaddr_event, 733 .notifier_call = dn_fib_dnaddr_event,
783}; 734};