Hello
i create a new packet
“newpkt” aodv and I create a function send_newpkt (for neighbor only )and
recv_newpkt and I call it in constructor (bold underlined )
AODV::AODV(nsaddr_t
id) : Agent(PT_AODV),
btimer(this),
htimer(this),
ntimer(this),
rtimer(this),
lrtimer(this),
rqueue()
{
...
logtarget
= 0;
ifqueue
= 0;
///
sendnewpkt();
}
and I have this error when
I run a tcl example
Scheduler: attempt to
schedule an event with a NULL handler. Don't DO that.
I think it's happen when
my newpkt is sent:
I create a newpkt exactly
like sendhello() but I didn't use any timer
exactly
here: Scheduler::instance().schedule(target_,
p, 0.);
must
I use a timer ??? I don't need to send my newpkt periodically, I just
send it once .
void
AODV::sendHello()
{
Packet
*p = Packet::alloc();
struct
hdr_cmn *ch
= HDR_CMN(p);
struct
hdr_ip *ih
= HDR_IP(p);
struct
hdr_aodv_reply
*rh = HDR_AODV_REPLY(p);
#ifdef
DEBUG
fprintf(stderr,
"sending Hello from %d at %.2f\n",
index, Scheduler::instance().clock());
#endif
// DEBUG
rh->rp_type
= AODVTYPE_HELLO;
//rh->rp_flags
= 0x00;
rh->rp_hop_count
= 1;
rh->rp_dst
= index;
rh->rp_dst_seqno
= seqno;
rh->rp_lifetime
= (1 + ALLOWED_HELLO_LOSS) * HELLO_INTERVAL;
//
ch->uid()
= 0;
ch->ptype() = PT_AODV;
ch->size() = IP_HDR_LEN +
rh->size();
ch->iface() = -2;
ch->error() = 0;
ch->addr_type() = NS_AF_NONE;
ch->prev_hop_
= index;
// AODV hack
ih->saddr() = index;
ih->daddr() = IP_BROADCAST;
ih->sport() = RT_PORT;
ih->dport() = RT_PORT;
ih->ttl_
= 1;
Scheduler::instance().schedule(target_,
p, 0.0);
}
Regards
_________________________________________________________________
Vous voulez savoir ce que vous pouvez faire avec le nouveau Windows Live ?
Lancez-vous !
http://www.microsoft.com/windows/windowslive/default.aspx