]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Testing if I can flush LSA from database.
authorOndrej Filip <feela@network.cz>
Wed, 3 May 2000 22:12:33 +0000 (22:12 +0000)
committerOndrej Filip <feela@network.cz>
Wed, 3 May 2000 22:12:33 +0000 (22:12 +0000)
proto/ospf/topology.c
proto/ospf/topology.h

index 56228054a026b1ccf211a86306427cc2f3fa4bf5..6a20a63db4cac71b65d5a1d014bfcf6b6593a80b 100644 (file)
@@ -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;
+}
index 4181e05f2e45c5133079708b8b19b3afd3e8873c..92b714386f610cff5d4e59a3de03c7a0ee3226b3 100644 (file)
@@ -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_ */