summaryrefslogtreecommitdiffstats
path: root/proto
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-05-04 00:12:33 +0200
committerOndrej Filip <feela@network.cz>2000-05-04 00:12:33 +0200
commitad5453b540b3c9d7430dcff9a3674d9db8ab999c (patch)
tree40de2c3c2245f07bab233bf2fe930ef8531e8ece /proto
parent9bc1808a27b35499d2438d731ade6d2cba8aa355 (diff)
downloadbird-ad5453b540b3c9d7430dcff9a3674d9db8ab999c.tar
bird-ad5453b540b3c9d7430dcff9a3674d9db8ab999c.zip
Testing if I can flush LSA from database.
Diffstat (limited to 'proto')
-rw-r--r--proto/ospf/topology.c32
-rw-r--r--proto/ospf/topology.h1
2 files changed, 33 insertions, 0 deletions
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;
+}
diff --git a/proto/ospf/topology.h b/proto/ospf/topology.h
index 4181e05..92b7143 100644
--- a/proto/ospf/topology.h
+++ b/proto/ospf/topology.h
@@ -48,5 +48,6 @@ void ospf_hash_delete(struct top_graph *, struct top_hash_entry *);
void addifa_rtlsa(struct ospf_iface *ifa);
void originate_rt_lsa(struct ospf_area *oa,struct proto_ospf *po);
void originate_net_lsa(struct ospf_iface *ifa,struct proto_ospf *po);
+int can_flush_lsa(struct ospf_area *oa);
#endif /* _BIRD_OSPF_TOPOLOGY_H_ */