summaryrefslogtreecommitdiffstats
path: root/proto/ospf/lsreq.c
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-03-31 02:21:41 +0200
committerOndrej Filip <feela@network.cz>2000-03-31 02:21:41 +0200
commitf45fd3164bf2f9342e12e867f8d68c7fc77d3177 (patch)
tree647d271be15eb20a1228db8507e8b73df84e7c25 /proto/ospf/lsreq.c
parent14a7921c83f0ecfc8793b3a38e4ac16ae9bd75d3 (diff)
downloadbird-f45fd3164bf2f9342e12e867f8d68c7fc77d3177.tar
bird-f45fd3164bf2f9342e12e867f8d68c7fc77d3177.zip
Sending of lspd as responce to lsreq done.
Diffstat (limited to 'proto/ospf/lsreq.c')
-rw-r--r--proto/ospf/lsreq.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/proto/ospf/lsreq.c b/proto/ospf/lsreq.c
index 91bc988..6829718 100644
--- a/proto/ospf/lsreq.c
+++ b/proto/ospf/lsreq.c
@@ -42,9 +42,9 @@ ospf_lsreq_tx(struct ospf_neighbor *n)
lsh->type=en->lsa.type;
lsh->rt=htonl(en->lsa.rt);
lsh->id=htonl(en->lsa.id);
- lsh++;
DBG("Requesting %uth LSA: Type: %u, Id: %u, RT: %u\n",i, en->lsa.type,
en->lsa.id, en->lsa.rt);
+ lsh++;
if((sn=sn->next)==NULL) break;
}
@@ -77,6 +77,9 @@ ospf_lsreq_rx(struct ospf_lsreq_packet *ps, struct proto *p,
u32 nrid, myrid;
struct ospf_neighbor *n;
struct ospf_lsreq_header *lsh;
+ struct l_lsr_head *llsh;
+ list uplist;
+ slab *upslab;
int length;
u8 i;
@@ -94,17 +97,28 @@ ospf_lsreq_rx(struct ospf_lsreq_packet *ps, struct proto *p,
length=htons(ps->ospf_packet.length);
lsh=(void *)(ps+1);
+ init_list(&uplist);
+ upslab=sl_new(p->pool,sizeof(struct l_lsr_head));
+
for(i=0;i<(length-sizeof(struct ospf_lsreq_packet))/
sizeof(struct ospf_lsreq_header);i++);
{
- DBG("Processing LSA: ID=%u, Type=%u, Router=%u\n", lsh->id, lsh->type,
- lsh->rt);
- if(ospf_hash_find(n->ifa->oa->gr, lsh->id, lsh->rt, lsh->type)==NULL)
+ DBG("Processing LSA: ID=%u, Type=%u, Router=%u\n", lsh->id,
+ ntohl(lsh->type), ntohl(lsh->rt));
+ llsh=sl_alloc(upslab);
+ llsh->lsh.id=ntohl(lsh->id);
+ llsh->lsh.rt=ntohl(lsh->rt);
+ llsh->lsh.type=ntohl(lsh->type);
+ add_tail(&uplist, NODE llsh);
+ if(ospf_hash_find(n->ifa->oa->gr, llsh->lsh.id, llsh->lsh.rt,
+ llsh->lsh.type)==NULL)
{
ospf_neigh_sm(n,INM_BADLSREQ);
+ rfree(upslab);
return;
}
- /* FIXME Go on */
}
+ ospf_lsupd_tx_list(n, &uplist);
+ rfree(upslab);
}