Hi all,
Don't know why if I comment out lines pointed by arrows below or move
lines with stars below the pointed lines , my packet is sent otherwise
not sent. if sent some of header fields like dph->hops_ will have
random values.
void DGRVNode::probe(Packet* old) {
struct hdr_uwip *ip_old = HDR_UWIP(old);
Packet *p = Packet::alloc();
struct hdr_cmn *cmh = HDR_CMN(p);
struct hdr_uwip *iph = HDR_UWIP(p);
struct hdr_dgr_probe *dph = HDR_DGR_PROBE(p);
cmh->direction() = hdr_cmn::DOWN;
cmh->uid() = uidcnt_++;
cmh->next_hop_ = UWIP_BROADCAST;
cmh->prev_hop_ = ipAddr_;
cmh->ptype() = PT_DGR;
iph->daddr() = UWIP_BROADCAST; //***********************
iph->saddr() = ipAddr_; //***********************
double sx, sy;
int h;
sink_list_->getLocbyID(ip_old->daddr(), sx, sy, h);
dph->type_ = DGRTYPE_PROBE;
dph->srcid_ = ipAddr_;
dph->sinkid_ = ip_old->daddr();
dph->seqno_ = seqno_++;
dph->alpha = 0;
dph->hops_ = 0;
dph->x_ = getPosition()->getX(); <----------------------------------
dph->y_ = getPosition()->getY(); <---------------------------------
// update path info
path_list_->new_path(dph->srcid_, dph->sinkid_, 0, 0, dph->seqno_,
dph->srctosinkhops_, 0);
if (trace_path_)
this->writePathInTrace(p, "SEND_PRB");
sendDown(p);
}
--
Tirivangani Magadza
JNTUH College of Engineering Hyderabad
India