From 2add26dfa9c1da1e7fd6248de593c60cf0eba9ca Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Wed, 26 Apr 2000 20:16:36 +0000 Subject: Stub networks done. --- proto/ospf/rt.c | 44 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c index d1425a52..60bf453c 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?*/ } } -- cgit v1.2.3