]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
LSA structure changes. (Len added.)
authorOndrej Filip <feela@network.cz>
Thu, 30 Mar 2000 20:18:51 +0000 (20:18 +0000)
committerOndrej Filip <feela@network.cz>
Thu, 30 Mar 2000 20:18:51 +0000 (20:18 +0000)
proto/ospf/topology.c
proto/ospf/topology.h

index 15163f93e34e1ffdb88468ccf644b4890e9e5861..6bbc5e700f254fdf25d845f02001962df4fefa67 100644 (file)
@@ -23,7 +23,7 @@
 #define HASH_LO_STEP 2
 #define HASH_LO_MIN 8
 
-void
+unsigned int
 make_rt_lsa(struct ospf_area *oa, struct proto_ospf *p)
 {
   struct ospf_iface *ifa;
@@ -147,17 +147,16 @@ make_rt_lsa(struct ospf_area *oa, struct proto_ospf *p)
   rt->links=i;
   if(old->lsa_body!=NULL) mb_free(old->lsa_body);
   old->lsa_body=rt;
+  return rt->links*sizeof(struct ospf_lsa_rt_link)+sizeof(struct ospf_lsa_rt);
 }
        
 
-       
 void
 addifa_rtlsa(struct ospf_iface *ifa)
 {
   struct ospf_area *oa;
   struct proto_ospf *po;
   u32 rtid;
-  struct top_hash_entry *rt;
   struct top_graph_rtlsa_link *li, *lih;
 
   po=ifa->proto;
@@ -196,8 +195,7 @@ addifa_rtlsa(struct ospf_iface *ifa)
     DBG("%s: New OSPF area \"%d\" added.\n", po->proto.name, ifa->an);
 
   }
-  make_rt_lsa(oa, po);
-  /* FIXME length? */
+  oa->rt->body_len=make_rt_lsa(oa, po);
   /*FIXME seq no++ */
   /*FIXME lsa_flood(oa->rt) */
 }
index 9ebd0ed748c1d6c39d23a831ab850d5ed734cc22..3e45bbf299600486dcc1112915ea287e92a4ccf8 100644 (file)
@@ -14,6 +14,7 @@ struct top_hash_entry {  /* Index for fast mapping (type,rtrid,LSid)->vertex */
   struct top_hash_entry *next;         /* Next in hash chain */
   struct ospf_lsa_header lsa;
   void *lsa_body;
+  unsigned int body_len;
 };
 
 struct top_graph {