Area work and router LSA starts when interface goes up.
This commit is contained in:
parent
ea28da044a
commit
ab56f6b16f
5 changed files with 43 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -23,6 +23,40 @@
|
|||
#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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue