This commit is contained in:
Ondrej Filip 2000-06-06 02:34:57 +00:00
parent 531a48d8c5
commit abcbfd0400
5 changed files with 28 additions and 29 deletions

View file

@ -36,7 +36,7 @@ ospf_dbdes_tx(struct ospf_neighbor *n)
op->length=htons(length); op->length=htons(length);
ospf_pkt_finalize(ifa, op); ospf_pkt_finalize(ifa, op);
sk_send_to(ifa->ip_sk,length, n->ip, OSPF_PROTO); sk_send_to(ifa->ip_sk,length, n->ip, OSPF_PROTO);
debug("%s: DB_DES (I) sent to %I via %s.\n", p->name, n->ip, OSPF_TRACE(D_PACKETS, "DB_DES (I) sent to %I via %s.", n->ip,
ifa->iface->name); ifa->iface->name);
break; break;
@ -117,7 +117,7 @@ ospf_dbdes_tx(struct ospf_neighbor *n)
} }
sk_send_to(ifa->ip_sk,length, n->ip, OSPF_PROTO); sk_send_to(ifa->ip_sk,length, n->ip, OSPF_PROTO);
debug("%s: DB_DES (M) sent to %I via %s.\n", p->name, n->ip, OSPF_TRACE(D_PACKETS, "DB_DES (M) sent to %I via %s.", n->ip,
ifa->iface->name); ifa->iface->name);
if(n->myimms.bit.ms) tm_start(n->rxmt_timer,ifa->rxmtint); if(n->myimms.bit.ms) tm_start(n->rxmt_timer,ifa->rxmtint);
else else
@ -206,18 +206,18 @@ ospf_dbdes_rx(struct ospf_dbdes_packet *ps, struct proto *p,
if((n=find_neigh(ifa, nrid))==NULL) if((n=find_neigh(ifa, nrid))==NULL)
{ {
debug("%s: Received dbdes from unknown neigbor! %I\n", p->name, OSPF_TRACE(D_PACKETS, "Received dbdes from unknown neigbor! %I.",
nrid); nrid);
return ; return ;
} }
if(ifa->iface->mtu<size) if(ifa->iface->mtu<size)
{ {
debug("%s: Received dbdes larger than MTU from %I!\n", p->name, n->ip); OSPF_TRACE(D_PACKETS, "Received dbdes larger than MTU from %I!", n->ip);
return ; return ;
} }
debug("%s: Received dbdes from %I via %s.\n", p->name, n->ip, OSPF_TRACE(D_PACKETS, "Received dbdes from %I via %s.", n->ip,
ifa->iface->name); ifa->iface->name);
ospf_neigh_sm(n, INM_HELLOREC); ospf_neigh_sm(n, INM_HELLOREC);
@ -242,7 +242,7 @@ ospf_dbdes_rx(struct ospf_dbdes_packet *ps, struct proto *p,
n->options=ps->options; n->options=ps->options;
n->myimms.bit.ms=0; n->myimms.bit.ms=0;
n->imms.byte=ps->imms.byte; n->imms.byte=ps->imms.byte;
debug("%s: I'm slave to %I. \n", p->name, n->ip); OSPF_TRACE(D_PACKETS, "I'm slave to %I.", n->ip);
ospf_neigh_sm(n, INM_NEGDONE); ospf_neigh_sm(n, INM_NEGDONE);
tm_stop(n->rxmt_timer); tm_stop(n->rxmt_timer);
ospf_dbdes_tx(n); ospf_dbdes_tx(n);
@ -257,7 +257,7 @@ ospf_dbdes_rx(struct ospf_dbdes_packet *ps, struct proto *p,
n->options=ps->options; n->options=ps->options;
n->ddr=ntohl(ps->ddseq)-1; n->ddr=ntohl(ps->ddseq)-1;
n->imms.byte=ps->imms.byte; n->imms.byte=ps->imms.byte;
debug("%s: I'm master to %I. \n", p->name, nrid); OSPF_TRACE(D_PACKETS, "I'm master to %I.", nrid);
ospf_neigh_sm(n, INM_NEGDONE); ospf_neigh_sm(n, INM_NEGDONE);
} }
else else
@ -273,7 +273,7 @@ ospf_dbdes_rx(struct ospf_dbdes_packet *ps, struct proto *p,
(ntohl(ps->ddseq)==n->ddr)) (ntohl(ps->ddseq)==n->ddr))
{ {
/* Duplicate packet */ /* Duplicate packet */
debug("%s: Received duplicate dbdes from %I!\n", p->name, n->ip); OSPF_TRACE(D_PACKETS, "Received duplicate dbdes from %I.", n->ip);
if(n->imms.bit.ms==0) if(n->imms.bit.ms==0)
{ {
ospf_dbdes_tx(n); ospf_dbdes_tx(n);
@ -347,7 +347,7 @@ ospf_dbdes_rx(struct ospf_dbdes_packet *ps, struct proto *p,
if((ps->imms.byte==n->imms.byte) && (ps->options=n->options) && if((ps->imms.byte==n->imms.byte) && (ps->options=n->options) &&
(ps->ddseq==n->dds)) /* Only duplicate are accepted */ (ps->ddseq==n->dds)) /* Only duplicate are accepted */
{ {
debug("%s: Received duplicate dbdes from %I!\n", p->name, n->ip); OSPF_TRACE(D_PACKETS, "Received duplicate dbdes from %I.",n->ip);
return; return;
} }
else else

View file

@ -58,7 +58,7 @@ ospf_hello_rx(struct ospf_hello_packet *ps, struct proto *p,
nrid=ntohl(((struct ospf_packet *)ps)->routerid); nrid=ntohl(((struct ospf_packet *)ps)->routerid);
debug("%s: Received hello from %I via %s\n",p->name,faddr,ifa->iface->name); OSPF_TRACE(D_PACKETS, "Received hello from %I via %s",faddr,ifa->iface->name);
if((unsigned)ipa_mklen(ipa_ntoh(ps->netmask))!=ifa->iface->addr->pxlen) if((unsigned)ipa_mklen(ipa_ntoh(ps->netmask))!=ifa->iface->addr->pxlen)
{ {
@ -87,7 +87,7 @@ ospf_hello_rx(struct ospf_hello_packet *ps, struct proto *p,
if((n=find_neigh(ifa, nrid))==NULL) if((n=find_neigh(ifa, nrid))==NULL)
{ {
debug("%s: New neighbor found: %I on %s.", p->name,faddr, OSPF_TRACE(D_EVENTS, "New neighbor found: %I on %s.", faddr,
ifa->iface->name); ifa->iface->name);
n=mb_allocz(p->pool, sizeof(struct ospf_neighbor)); n=mb_allocz(p->pool, sizeof(struct ospf_neighbor));
add_tail(&ifa->neigh_list, NODE n); add_tail(&ifa->neigh_list, NODE n);
@ -255,7 +255,7 @@ hello_timer_hook(timer *timer)
} }
sk_send_to_agt(ifa->ip_sk, length, ifa, NEIGHBOR_DOWN); sk_send_to_agt(ifa->ip_sk, length, ifa, NEIGHBOR_DOWN);
} }
debug("%s: Hello sent via %s\n",p->name,ifa->iface->name); OSPF_TRACE(D_PACKETS, "Hello sent via %s",ifa->iface->name);
} }
void void

View file

@ -25,8 +25,8 @@ iface_chstate(struct ospf_iface *ifa, u8 state)
if(ifa->state!=state) if(ifa->state!=state)
{ {
debug("%s: Changing state of iface: %s from \"%s\" into \"%s\".\n", OSPF_TRACE(D_EVENTS, "Changing state of iface: %s from \"%s\" into \"%s\".",
p->name, ifa->iface->name, ospf_is[ifa->state], ospf_is[state]); ifa->iface->name, ospf_is[ifa->state], ospf_is[state]);
oldstate=ifa->state; oldstate=ifa->state;
ifa->state=state; ifa->state=state;
if(ifa->iface->flags & IF_MULTICAST) if(ifa->iface->flags & IF_MULTICAST)
@ -87,7 +87,7 @@ downint(struct ospf_iface *ifa)
WALK_LIST_DELSAFE(n,nx,ifa->neigh_list) WALK_LIST_DELSAFE(n,nx,ifa->neigh_list)
{ {
debug("%s: Removing neighbor %I\n", p->name, n->ip); OSPF_TRACE(D_EVENTS, "%s: Removing neighbor %I", n->ip);
ospf_neigh_remove(n); ospf_neigh_remove(n);
} }
rem_node(NODE ifa); rem_node(NODE ifa);
@ -124,8 +124,8 @@ ospf_int_sm(struct ospf_iface *ifa, int event)
struct proto_ospf *po=ifa->proto; struct proto_ospf *po=ifa->proto;
struct ospf_area *oa=ifa->oa; struct ospf_area *oa=ifa->oa;
debug("%s: SM on iface %s. Event is \"%s\".\n", OSPF_TRACE(D_EVENTS, "SM on iface %s. Event is \"%s\".",
p->name, ifa->iface->name, ospf_ism[event]); ifa->iface->name, ospf_ism[event]);
switch(event) switch(event)
{ {
@ -299,7 +299,6 @@ ospf_if_notify(struct proto *p, unsigned flags, struct iface *iface)
if(flags & IF_CHANGE_UP) if(flags & IF_CHANGE_UP)
{ {
debug("%s: using interface %s.\n", p->name, iface->name);
WALK_LIST(ac, c->area_list) WALK_LIST(ac, c->area_list)
{ {
if(ip=(struct ospf_iface_patt *) if(ip=(struct ospf_iface_patt *)
@ -308,6 +307,7 @@ ospf_if_notify(struct proto *p, unsigned flags, struct iface *iface)
if(ip) if(ip)
{ {
OSPF_TRACE(D_EVENTS, "Using interface %s.", iface->name);
lock = olock_new( p->pool ); lock = olock_new( p->pool );
lock->addr = AllSPFRouters; lock->addr = AllSPFRouters;
lock->type = OBJLOCK_UDP; lock->type = OBJLOCK_UDP;
@ -323,7 +323,7 @@ ospf_if_notify(struct proto *p, unsigned flags, struct iface *iface)
{ {
if((ifa=find_iface((struct proto_ospf *)p, iface))!=NULL) if((ifa=find_iface((struct proto_ospf *)p, iface))!=NULL)
{ {
debug("%s: killing interface %s.\n", p->name, iface->name); OSPF_TRACE(D_EVENTS, "Killing interface %s.", iface->name);
ospf_int_sm(ifa, ISM_DOWN); ospf_int_sm(ifa, ISM_DOWN);
} }
} }
@ -332,7 +332,7 @@ ospf_if_notify(struct proto *p, unsigned flags, struct iface *iface)
{ {
if((ifa=find_iface((struct proto_ospf *)p, iface))!=NULL) if((ifa=find_iface((struct proto_ospf *)p, iface))!=NULL)
{ {
debug("%s: changing MTU on interface %s.\n", p->name, iface->name); OSPF_TRACE(D_EVENTS, "Changing MTU on interface %s.", iface->name);
/* FIXME: change MTU */ /* FIXME: change MTU */
} }
} }

View file

@ -37,8 +37,8 @@ neigh_chstate(struct ospf_neighbor *n, u8 state)
n->state=state; n->state=state;
debug("%s: Neighbor %I changes state from \"%s\" to \"%s\".\n", OSPF_TRACE( D_EVENTS, "Neighbor %I changes state from \"%s\" to \"%s\".",
p->name, n->ip, ospf_ns[oldstate], ospf_ns[state]); n->ip, ospf_ns[oldstate], ospf_ns[state]);
if((state==NEIGHBOR_2WAY) && (oldstate<NEIGHBOR_2WAY)) if((state==NEIGHBOR_2WAY) && (oldstate<NEIGHBOR_2WAY))
ospf_int_sm(ifa, ISM_NEICH); ospf_int_sm(ifa, ISM_NEICH);
@ -278,7 +278,7 @@ ospf_neigh_sm(struct ospf_neighbor *n, int event)
break; break;
case INM_SEQMIS: case INM_SEQMIS:
case INM_BADLSREQ: case INM_BADLSREQ:
debug("%s: Bad LS req!\n", p->name); OSPF_TRACE(D_EVENTS, "Bad LS req!");
if(n->state>=NEIGHBOR_EXCHANGE) if(n->state>=NEIGHBOR_EXCHANGE)
{ {
neigh_chstate(n,NEIGHBOR_EXSTART); neigh_chstate(n,NEIGHBOR_EXSTART);
@ -439,8 +439,8 @@ neighbor_timer_hook(timer *timer)
n=(struct ospf_neighbor *)timer->data; n=(struct ospf_neighbor *)timer->data;
ifa=n->ifa; ifa=n->ifa;
p=(struct proto *)(ifa->proto); p=(struct proto *)(ifa->proto);
debug("%s: Inactivity timer fired on interface %s for neighbor %I.\n", OSPF_TRACE(D_EVENTS,"Inactivity timer fired on interface %s for neighbor %I.",
p->name, ifa->iface->name, n->ip); ifa->iface->name, n->ip);
ospf_neigh_remove(n); ospf_neigh_remove(n);
} }
@ -484,7 +484,7 @@ ospf_neigh_remove(struct ospf_neighbor *n)
} }
rem_node(NODE n); rem_node(NODE n);
mb_free(n); mb_free(n);
debug("%s: Deleting neigbor.\n", p->name); OSPF_TRACE(D_EVENTS, "Deleting neigbor.");
} }
void void

View file

@ -45,7 +45,7 @@ ospf_rt_spfa(struct ospf_area *oa)
ip_addr ip; ip_addr ip;
struct ospf_lsa_net *ln; struct ospf_lsa_net *ln;
debug("%s: Starting routing table calculation for area %I\n",p->name, OSPF_TRACE(D_EVENTS, "Starting routing table calculation for area %I",
oa->areaid); oa->areaid);
if(oa->rt==NULL) return; if(oa->rt==NULL) return;
@ -266,8 +266,7 @@ ospf_ext_spfa(struct proto_ospf *po) /* FIXME looking into inter-area */
u32 tag; u32 tag;
neighbor *nn; neighbor *nn;
debug("%s: Starting routing table calculation for external routes\n", OSPF_TRACE(D_EVENTS,"Starting routing table calculation for ext routes");
p->name);
FIB_WALK(ef,nftmp) FIB_WALK(ef,nftmp)
{ {