Add hashing to link state request list.

This commit is contained in:
Ondrej Filip 2000-03-30 19:37:26 +00:00
parent 76915ec979
commit 95eb1dba3f
3 changed files with 16 additions and 10 deletions

View file

@ -234,15 +234,19 @@ ospf_dbdes_reqladd(struct ospf_dbdes_packet *ps, struct proto *p,
for(i=0;i<j;i++) for(i=0;i<j;i++)
{ {
ntohlsah(plsa+i, &lsa); ntohlsah(plsa+i, &lsa);
/* FIXME Test Checksum */ /* FIXME Test Checksum */
if(((he=ospf_hash_find(gr,lsa.id,lsa.rt,lsa.type))==NULL)|| if(((he=ospf_hash_find(gr,lsa.id,lsa.rt,lsa.type))==NULL)||
(lsa_comp(&lsa, &(he->lsa))==1)) (lsa_comp(&lsa, &(he->lsa))==1))
{ {
sn=sl_alloc(gr->hash_slab); /* Is this confition necessary? */
ntohlsah(plsa+i, &(sn->lsa)); if(ospf_hash_find(n->lsrqh,lsa.id,lsa.rt,lsa.type)==NULL)
s_add_tail(&(n->lsrql), SNODE sn); {
} sn=ospf_hash_get(n->lsrqh,lsa.id,lsa.rt,lsa.type);
ntohlsah(plsa+i, &(sn->lsa));
s_add_tail(&(n->lsrql), SNODE sn);
}
}
} }
} }

View file

@ -208,6 +208,7 @@ ospf_neigh_sm(struct ospf_neighbor *n, int event)
{ {
neigh_chstate(n,NEIGHBOR_EXCHANGE); neigh_chstate(n,NEIGHBOR_EXCHANGE);
s_init_list(&(n->lsrql)); s_init_list(&(n->lsrql));
n->lsrqh=ospf_top_new(n->ifa->proto);
s_init_list(&(n->lsrtl)); s_init_list(&(n->lsrtl));
s_init(&(n->dbsi), &(n->ifa->oa->lsal)); s_init(&(n->dbsi), &(n->ifa->oa->lsal));
s_init(&(n->lsrqi), &(n->lsrql)); s_init(&(n->lsrqi), &(n->lsrql));

View file

@ -272,7 +272,8 @@ struct ospf_neighbor
u32 bdr; /* Neigbour's idea of BDR */ u32 bdr; /* Neigbour's idea of BDR */
u8 adj; /* built adjacency? */ u8 adj; /* built adjacency? */
siterator dbsi; /* Database summary list iterator */ siterator dbsi; /* Database summary list iterator */
slist lsrql; /* Link state request */ /* FIXME add hashing? */ slist lsrql; /* Link state request */
struct top_graph *lsrqh; /* LSA graph */
siterator lsrqi; siterator lsrqi;
slist lsrtl; /* Link state retransmission list */ slist lsrtl; /* Link state retransmission list */
siterator lsrti; siterator lsrti;