From ad5453b540b3c9d7430dcff9a3674d9db8ab999c Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Wed, 3 May 2000 22:12:33 +0000 Subject: Testing if I can flush LSA from database. --- proto/ospf/topology.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'proto/ospf/topology.c') diff --git a/proto/ospf/topology.c b/proto/ospf/topology.c index 5622805..6a20a63 100644 --- a/proto/ospf/topology.c +++ b/proto/ospf/topology.c @@ -502,3 +502,35 @@ ospf_top_dump(struct top_graph *f) } } +/* This is very uneficient, please don't call it often */ + +/* I should also test for every LSA if it's in some link state + * retransmision list for every neighbor. I will not test it. + * It can happen that I'll receive some strange ls ack's. + */ + +int +can_flush_lsa(struct ospf_area *oa) +{ + struct ospf_iface *ifa; + struct ospf_neighbor *n; + struct proto_ospf *po=oa->po; + int flush=1; + + WALK_LIST(ifa, iface_list) + { + if(ifa->oa==oa) + { + WALK_LIST(n, ifa->neigh_list) + { + if(n->state==NEIGHBOR_EXCHANGE||n->state==NEIGHBOR_LOADING) + { + flush=0; + break; + } + } + } + } + + return flush; +} -- cgit v1.2.3