mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-17 08:38:42 +00:00
Tracing in topology
This commit is contained in:
parent
d3995c498d
commit
992705f65a
@ -81,7 +81,7 @@ ospf_dump(struct proto *p)
|
|||||||
WALK_LIST(NODE oa,po->area_list)
|
WALK_LIST(NODE oa,po->area_list)
|
||||||
{
|
{
|
||||||
OSPF_TRACE(D_EVENTS, "LSA graph dump for area \"%I\" start:", oa->areaid);
|
OSPF_TRACE(D_EVENTS, "LSA graph dump for area \"%I\" start:", oa->areaid);
|
||||||
ospf_top_dump(oa->gr);
|
ospf_top_dump(oa->gr,p);
|
||||||
OSPF_TRACE(D_EVENTS, "LSA graph dump for area \"%I\" finished", oa->areaid);
|
OSPF_TRACE(D_EVENTS, "LSA graph dump for area \"%I\" finished", oa->areaid);
|
||||||
}
|
}
|
||||||
neigh_dump_all();
|
neigh_dump_all();
|
||||||
|
@ -174,11 +174,12 @@ originate_rt_lsa(struct ospf_area *oa)
|
|||||||
{
|
{
|
||||||
struct ospf_lsa_header lsa;
|
struct ospf_lsa_header lsa;
|
||||||
struct proto_ospf *po=oa->po;
|
struct proto_ospf *po=oa->po;
|
||||||
|
struct proto *p=&po->proto;
|
||||||
u32 rtid=po->proto.cf->global->router_id;
|
u32 rtid=po->proto.cf->global->router_id;
|
||||||
struct top_hash_entry *en;
|
struct top_hash_entry *en;
|
||||||
void *body;
|
void *body;
|
||||||
|
|
||||||
debug("%s: Originating RT_lsa for area \"%I\".\n",po->proto.name,oa->areaid);
|
OSPF_TRACE(D_EVENTS, "Originating RT_lsa for area \"%I\".",oa->areaid);
|
||||||
|
|
||||||
lsa.age=0;
|
lsa.age=0;
|
||||||
lsa.id=rtid;
|
lsa.id=rtid;
|
||||||
@ -236,9 +237,10 @@ originate_net_lsa(struct ospf_iface *ifa, struct proto_ospf *po)
|
|||||||
struct ospf_lsa_header lsa;
|
struct ospf_lsa_header lsa;
|
||||||
u32 rtid=po->proto.cf->global->router_id;
|
u32 rtid=po->proto.cf->global->router_id;
|
||||||
struct top_hash_entry *en;
|
struct top_hash_entry *en;
|
||||||
|
struct proto *p=&po->proto;
|
||||||
void *body;
|
void *body;
|
||||||
|
|
||||||
debug("%s: Originating Net lsa for iface \"%s\".\n", po->proto.name,
|
OSPF_TRACE(D_EVENTS, "Originating Net lsa for iface \"%s\".",
|
||||||
ifa->iface->name);
|
ifa->iface->name);
|
||||||
|
|
||||||
if((ifa->state!=OSPF_IS_DR)||(ifa->fadj==0))
|
if((ifa->state!=OSPF_IS_DR)||(ifa->fadj==0))
|
||||||
@ -272,8 +274,6 @@ originate_net_lsa(struct ospf_iface *ifa, struct proto_ospf *po)
|
|||||||
body=originate_net_lsa_body(ifa, &lsa.length, po);
|
body=originate_net_lsa_body(ifa, &lsa.length, po);
|
||||||
lsasum_calculate(&lsa,body,po);
|
lsasum_calculate(&lsa,body,po);
|
||||||
ifa->nlsa=lsa_install_new(&lsa, body, ifa->oa, &po->proto);
|
ifa->nlsa=lsa_install_new(&lsa, body, ifa->oa, &po->proto);
|
||||||
debug("NetLsa: Id: %I, Sum: %u Sn: 0x%x\n",ifa->nlsa->lsa.id,
|
|
||||||
ifa->nlsa->lsa.checksum, ifa->nlsa->lsa.sn);
|
|
||||||
flood_lsa(NULL,NULL,&ifa->nlsa->lsa,po,NULL,ifa->oa,1);
|
flood_lsa(NULL,NULL,&ifa->nlsa->lsa,po,NULL,ifa->oa,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -329,7 +329,7 @@ originate_ext_lsa(net *n, rte *e, struct proto_ospf *po, struct ea_list *attrs)
|
|||||||
struct ospf_lsa_ext *ext1,*ext2;
|
struct ospf_lsa_ext *ext1,*ext2;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
debug("%s: Originating Ext lsa for %I/%d.\n", po->proto.name, n->n.prefix,
|
OSPF_TRACE(D_EVENTS, "Originating Ext lsa for %I/%d.", n->n.prefix,
|
||||||
n->n.pxlen);
|
n->n.pxlen);
|
||||||
|
|
||||||
lsa.age=0;
|
lsa.age=0;
|
||||||
@ -548,17 +548,18 @@ ospf_hash_delete(struct top_graph *f, struct top_hash_entry *e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ospf_top_dump(struct top_graph *f)
|
ospf_top_dump(struct top_graph *f, struct proto *p)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
debug("Hash entries: %d\n", f->hash_entries);
|
OSPF_TRACE(D_EVENTS, "Hash entries: %d", f->hash_entries);
|
||||||
|
|
||||||
for(i=0; i<f->hash_size; i++)
|
for(i=0; i<f->hash_size; i++)
|
||||||
{
|
{
|
||||||
struct top_hash_entry *e = f->hash_table[i];
|
struct top_hash_entry *e = f->hash_table[i];
|
||||||
while (e)
|
while (e)
|
||||||
{
|
{
|
||||||
debug("\t%1x %8I %8I %4u 0x%08x\n", e->lsa.type, e->lsa.id,
|
OSPF_TRACE(D_EVENTS, "\t%1x %8I %8I %4u 0x%08x",
|
||||||
|
e->lsa.type, e->lsa.id,
|
||||||
e->lsa.rt, e->lsa.age, e->lsa.sn);
|
e->lsa.rt, e->lsa.age, e->lsa.sn);
|
||||||
e = e->next;
|
e = e->next;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ struct top_graph {
|
|||||||
|
|
||||||
struct top_graph *ospf_top_new(struct proto_ospf *);
|
struct top_graph *ospf_top_new(struct proto_ospf *);
|
||||||
void ospf_top_free(struct top_graph *);
|
void ospf_top_free(struct top_graph *);
|
||||||
void ospf_top_dump(struct top_graph *);
|
void ospf_top_dump(struct top_graph *, struct proto *);
|
||||||
struct top_hash_entry *ospf_hash_find_header(struct top_graph *f, struct ospf_lsa_header *h);
|
struct top_hash_entry *ospf_hash_find_header(struct top_graph *f, struct ospf_lsa_header *h);
|
||||||
struct top_hash_entry *ospf_hash_get_header(struct top_graph *f, struct ospf_lsa_header *h);
|
struct top_hash_entry *ospf_hash_get_header(struct top_graph *f, struct ospf_lsa_header *h);
|
||||||
struct top_hash_entry *ospf_hash_find(struct top_graph *, u32 lsa, u32 rtr, u32 type);
|
struct top_hash_entry *ospf_hash_find(struct top_graph *, u32 lsa, u32 rtr, u32 type);
|
||||||
|
Loading…
Reference in New Issue
Block a user