summaryrefslogtreecommitdiffstats
path: root/proto/ospf
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-04-26 22:16:36 +0200
committerOndrej Filip <feela@network.cz>2000-04-26 22:16:36 +0200
commit2add26dfa9c1da1e7fd6248de593c60cf0eba9ca (patch)
tree5dc3e7d35711c0eec0c8a41c0c87f5db3730e540 /proto/ospf
parent5904a51266d82482392bad5d6d17a3be54c65596 (diff)
downloadbird-2add26dfa9c1da1e7fd6248de593c60cf0eba9ca.tar
bird-2add26dfa9c1da1e7fd6248de593c60cf0eba9ca.zip
Stub networks done.
Diffstat (limited to 'proto/ospf')
-rw-r--r--proto/ospf/rt.c44
1 files changed, 40 insertions, 4 deletions
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c
index d1425a5..60bf453 100644
--- a/proto/ospf/rt.c
+++ b/proto/ospf/rt.c
@@ -8,13 +8,19 @@
#include "ospf.h"
+/* FIXME next hop calculation
+ * FIXME sync with BIRD's routing table
+ */
+
void
ospf_rt_spfa(struct ospf_area *oa, struct proto *p)
{
- struct top_hash_entry *en;
+ struct top_hash_entry *en, *nx;
slab *sl;
struct spf_n *cn;
u32 i,*rts;
+ struct ospf_lsa_rt *rt;
+ struct ospf_lsa_rt_link *rtl;
/*
* First of all, mark all vertices as they are not in SPF
@@ -42,8 +48,6 @@ ospf_rt_spfa(struct ospf_area *oa, struct proto *p)
{
struct top_hash_entry *act,*tmp;
node *n;
- struct ospf_lsa_rt *rt;
- struct ospf_lsa_rt_link *rtl;
struct ospf_lsa_net *net;
n=HEAD(oa->cand);
@@ -92,6 +96,35 @@ ospf_rt_spfa(struct ospf_area *oa, struct proto *p)
break;
}
}
+
+ /* Now calculate routes to stub networks */
+
+ WALK_SLIST_DELSAFE(SNODE en, SNODE nx, oa->lsal)
+ {
+ if((en->lsa.type==LSA_T_RT)||(en->lsa.type==LSA_T_NET))
+ {
+ if(en->dist==LSINFINITY)
+ {
+ s_rem_node(SNODE en);
+ /* FIXME Remove from routing table! */
+ mb_free(en->lsa_body);
+ ospf_hash_delete(oa->gr, en);
+ }
+ if(en->lsa.type==LSA_T_NET)
+ {
+ rt=(struct ospf_lsa_rt *)en->lsa_body;
+ if((rt->VEB)&(1>>LSA_RT_V)) oa->trcap=1;
+ rtl=(struct ospf_lsa_rt_link *)(rt+1);
+ for(i=0;rt->links;i++)
+ {
+ if((rtl+i)->type==LSART_STUB)
+ {
+ /* Check destination and so on (pg 166) */
+ }
+ }
+ }
+ }
+ }
}
void
@@ -110,7 +143,8 @@ add_cand(list *l, struct top_hash_entry *en, u16 dist, slab *s)
if(dist==en->dist)
{
- //Next hop calc
+ //Add Next hop
+ //And add it to routing table (Multiple path?)
}
else
{
@@ -150,5 +184,7 @@ add_cand(list *l, struct top_hash_entry *en, u16 dist, slab *s)
break;
}
}
+ /* FIXME Some VLINK staff should be here */
+ /* Routing table add?*/
}
}