diff options
author | Ondrej Filip <feela@network.cz> | 2000-05-03 00:19:41 +0200 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 2000-05-03 00:19:41 +0200 |
commit | c45f48fba5a0904f9c3512c3b42c38183fef348b (patch) | |
tree | 3679fc0a54a1bc3f316d6024d4c90d4997d065ff /proto/ospf/rt.c | |
parent | a92847e78fabd637938f324c78d5eb41538a5692 (diff) | |
download | bird-c45f48fba5a0904f9c3512c3b42c38183fef348b.tar bird-c45f48fba5a0904f9c3512c3b42c38183fef348b.zip |
Aging of lsa database added.
Diffstat (limited to 'proto/ospf/rt.c')
-rw-r--r-- | proto/ospf/rt.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c index d9ec0fd..5a6aa37 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 */ |