summaryrefslogtreecommitdiff
path: root/proto/ospf/ospf.c
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-05-31 14:06:33 +0000
committerOndrej Filip <feela@network.cz>2000-05-31 14:06:33 +0000
commit70a383198ae08bed395f2a083c1bea5b37447705 (patch)
tree1a67b5135a041977a5928d5885f702718d28b21a /proto/ospf/ospf.c
parentaa185265f1cb310c053edb1a3bde28b4dab94964 (diff)
LSArt origination and routing table calculation is now not doing so
often. Instead of calculation I just schedule it latter.
Diffstat (limited to 'proto/ospf/ospf.c')
-rw-r--r--proto/ospf/ospf.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c
index 15e9ea45..701c3230 100644
--- a/proto/ospf/ospf.c
+++ b/proto/ospf/ospf.c
@@ -135,6 +135,47 @@ ospf_build_attrs(ea_list *next, struct linpool *pool, u32 m1, u32 m2, u32 tag)
return l;
}
+void
+schedule_rt_lsa(struct ospf_area *oa)
+{
+ struct proto_ospf *po=oa->po;
+ struct proto *p=&po->proto;
+
+ debug("%s: Scheduling RT lsa origination for area %I.\n", p->name,
+ oa->areaid);
+ oa->origrt=1;
+}
+
+void
+schedule_rtcalc(struct ospf_area *oa)
+{
+ struct proto_ospf *po=oa->po;
+ struct proto *p=&po->proto;
+
+ debug("%s: Scheduling RT calculation for area %I.\n", p->name,
+ oa->areaid);
+ oa->calcrt=1;
+}
+
+void
+area_disp(timer *timer)
+{
+ struct ospf_area *oa=timer->data;
+ struct top_hash_entry *en,*nxt;
+ int flush=0;
+
+ /* First of all try to age LSA DB */
+ flush=can_flush_lsa(oa);
+ WALK_SLIST_DELSAFE(en,nxt,oa->lsal) ospf_age(en,DISPTICK,flush,oa);
+
+ /* Now try to originage rt_lsa */
+ if(oa->origrt) originate_rt_lsa(oa);
+ oa->origrt=0;
+
+ if(oa->calcrt) ospf_rt_spfa(oa);
+ oa->calcrt=0;
+}
+
int
ospf_import_control(struct proto *p, rte **new, ea_list **attrs, struct linpool *pool)
{