]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Area work and router LSA starts when interface goes up.
authorOndrej Filip <feela@network.cz>
Thu, 24 Feb 2000 00:26:10 +0000 (00:26 +0000)
committerOndrej Filip <feela@network.cz>
Thu, 24 Feb 2000 00:26:10 +0000 (00:26 +0000)
proto/ospf/iface.c
proto/ospf/ospf.c
proto/ospf/ospf.h
proto/ospf/topology.c
proto/ospf/topology.h

index 0ee5e685560d9d342fd7fcc80ea158c448aae7be..cd8b035ddfebc94fc03899e904a3feb93193be6f 100644 (file)
@@ -40,6 +40,7 @@ ospf_int_sm(struct ospf_iface *ifa, int event)
     case ISM_UP:
       if(ifa->state==OSPF_IS_DOWN)
       {
+        /* Now, nothing should be adjacent */
         restart_hellotim(ifa);
         if((ifa->type==OSPF_IT_PTP) || (ifa->type==OSPF_IT_VLINK))
         {
@@ -57,6 +58,7 @@ ospf_int_sm(struct ospf_iface *ifa, int event)
              restart_waittim(ifa);
           }
         }
+       addifa_rtlsa(ifa);
       }
       break;
     case ISM_BACKS:
@@ -307,6 +309,7 @@ ospf_if_notify(struct proto *p, unsigned flags, struct iface *iface)
     ifa->waitint=0;
     ospf_add_timers(ifa,p->pool);
     add_tail(&((struct proto_ospf *)p)->iface_list, NODE ifa);
+    ifa->state=OSPF_IS_DOWN;
     ospf_int_sm(ifa, ISM_UP);
   }
 
index 1805ac3f8d65f59629d55cf9784380d5aed302c9..1cf6175a9e8461d01aa8a6fb2bb3076a9a43f26f 100644 (file)
@@ -22,7 +22,10 @@ ospf_start(struct proto *p)
   po->firstarea->gr=ospf_top_new(po);
   po->firstarea->next=NULL;
   po->firstarea->areaid=0;
-  
+
+  po->areano=0;                /* Waiting for interfaces comming up */
+  po->firstarea=NULL;
+  po->areaslab=sl_new(p->pool, sizeof(struct ospf_area));
   return PS_UP;
 }
 
index 647debad95a0d7ec055b65094d8677c166915562..05e79e7316e3ae662b11d2cc263be51b187d05ae 100644 (file)
@@ -220,6 +220,7 @@ struct proto_ospf {
   list iface_list;             /* Interfaces we really use */
   int areano;                  /* Number of area I belong to */
   struct ospf_area *firstarea;
+  slab *areaslab;
 };
 
 static int ospf_start(struct proto *p);
index db2065bbfc5c9ab032b89842dfae709d78d22742..60dbd4f91939e1b21adc41565091c0315b3b7f40 100644 (file)
 #define HASH_LO_STEP 2
 #define HASH_LO_MIN 8
 
+void
+addifa_rtlsa(struct ospf_iface *ifa)
+{
+  struct ospf_area *oa;
+  struct proto_ospf *po;
+
+  po=ifa->proto;
+  oa=po->firstarea;
+
+  while(oa!=NULL)
+  {
+    if(oa->areaid==ifa->area) break;
+    oa=oa->next;
+  }
+  if(oa!=NULL) /* Known area */
+  {
+    /**/;
+  }
+  else /* New area */
+  {
+    po->areano++;
+    oa=po->firstarea;
+    po->firstarea=sl_alloc(po->areaslab);
+    po->firstarea->next=oa;
+    po->firstarea->areaid=ifa->area;
+    po->firstarea->gr=ospf_top_new(po);
+  }
+
+  /* FIXME Go on, change router lsa, bits and so on... */
+}
+
+  
+
 static void
 ospf_top_ht_alloc(struct top_graph *f)
 {
index f102851a8163a20b09dffdcad3dbaf697b5f7829..ec0704cdd5251a0a0f7d3bc8d567100d18df1954 100644 (file)
@@ -36,6 +36,7 @@ void ospf_top_dump(struct top_graph *);
 struct top_hash_entry *ospf_hash_find(struct top_graph *, u32 lsa, u32 rtr, u32 type);
 struct top_hash_entry *ospf_hash_get(struct top_graph *, u32 lsa, u32 rtr, u32 type);
 void ospf_hash_delete(struct top_graph *, struct top_hash_entry *);
+void addifa_rtlsa(struct ospf_iface *ifa);
 
 struct top_graph_rtlsa {
   u8 Vbit;