From c45f48fba5a0904f9c3512c3b42c38183fef348b Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Tue, 2 May 2000 22:19:41 +0000 Subject: Aging of lsa database added. --- proto/ospf/rt.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'proto/ospf/rt.c') 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 */ -- cgit v1.2.3