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))
{
restart_waittim(ifa);
}
}
+ addifa_rtlsa(ifa);
}
break;
case ISM_BACKS:
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);
}
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;
}
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);
#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)
{
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;