summaryrefslogtreecommitdiff
path: root/proto/ospf/rt.c
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-05-02 22:19:41 +0000
committerOndrej Filip <feela@network.cz>2000-05-02 22:19:41 +0000
commitc45f48fba5a0904f9c3512c3b42c38183fef348b (patch)
tree3679fc0a54a1bc3f316d6024d4c90d4997d065ff /proto/ospf/rt.c
parenta92847e78fabd637938f324c78d5eb41538a5692 (diff)
Aging of lsa database added.
Diffstat (limited to 'proto/ospf/rt.c')
-rw-r--r--proto/ospf/rt.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c
index d9ec0fdb..5a6aa373 100644
--- a/proto/ospf/rt.c
+++ b/proto/ospf/rt.c
@@ -26,17 +26,21 @@ ospf_rt_spfa(struct ospf_area *oa, struct proto *p)
struct ospf_lsa_rt_link *rtl,*rr;
struct fib fib;
struct stub_fib *sf;
+ bird_clock_t delta;
+ int age=0,flush=0;
- /*
- * First of all, mark all vertices as they are not in SPF
- * Maybe I can join this work with Aging of structure
- * FIXME look at it
- */
+ /* FIXME if I'm not in LOADING or EXCHANGE set flush=1 */
+ if((delta=now-oa->lage)>=AGINGDELTA)
+ {
+ oa->lage=now;
+ age=1;
+ }
- WALK_SLIST(SNODE en, oa->lsal)
+ WALK_SLIST_DELSAFE(SNODE en, nx, oa->lsal) /* FIXME Make it DELSAFE */
{
en->color=OUTSPF;
en->dist=LSINFINITY;
+ if(age) ospf_age(en,delta,flush,p);
}
init_list(&oa->cand); /* Empty list of candidates */