Hi
I tried to write a new queue that cache some data which has frametype=1 in
an array, and when a nack packe income to queue search array if there is
send the stored packe in cache.  but I use AODV in simulation TCl and have
segmentation fault can you help me?


void DtRrQueue::enque(Packet* p)
{
  hdr_ip* ih = hdr_ip::access(p);
  hdr_cmn* ch = hdr_cmn::access(p);

  Packet *p2=p->copy();


  hdr_ip* ih2 = hdr_ip::access(p2);
  hdr_cmn* ch2 = hdr_cmn::access(p2);

  if ( ch->nack_==1) // recive a nack packet
   {  find=0;
for(int f=0; f<1000;f++)
  {  if (q3_[f]!=0){
    hdr_cmn* ch3 = hdr_cmn::access(q3_[f]);
    if (ch3->uid_==ch->uid_)
    {find=1;   temp=f; break;}
    }}

    if (find==1)
    {

      q1_->enque(q3_[temp]  );

     drop(p);

       }
      else {
       q1_->enque(p);
    }

 }

  else { // this is a data packet
    q1_->enque(p);


 if (ch2->frametype_==1 && ch2->nack_==0) {
 q3_[index]=p2;
 index++;
 }

 }//else
  }

Reply via email to