HI *Faisal Siddiqui,
*
i saw ur post on developing new queue management. I heard u said it is
possible toget the packets from nodes and store them in a storage beofre
sendin them to the queue.

ot i want to  do is collect these packets and create two storages for them
9one for realtime packets RT and non realtime packets NRT. I want to send
the RT packets to thequeue immediately while wait for the queue to be empty
before sending the NRT packets.

I am trying to modify Priqueue to do that.

I have the following codes tos how for it, I only edited the recv (packet,
handler function)
Is this the way to go by my concept?

void
PriQueue::recv(Packet *p, Handler *h)
{
       static Packet packetqueue[50];
       //static Handler* handlerqueue[50];
       static int qsize = 0;

       struct hdr_cmn *ch = HDR_CMN(p);

       if(Prefer_Routing_Protocols) {

               switch(ch->ptype()) {
               case PT_DSR:
               case PT_MESSAGE:
               case PT_TORA:
               case PT_AODV:
                       recvHighPriority(p, h);
                       break;
               case PT_UDP:
               case PT_RTP:
                       Queue::recv(p,h);
                       break;
      default:
       //              Queue::recv(p,h);
               {       if (qsize%50 < 50)
                       {
                               if (q_->length() == 0) //check if queue is
empty
                               {
                               packetqueue[qsize++%50] = *p;
                               //handlerqueue[qsize++] = h;
                                       for (int j=0; j<qsize%50; j++)
                                       {
                                       printf("%i \t",qsize%50);

                                       Queue::recv(&packetqueue[j],h);
                                       }
                               }
                               else
                               {
                               packetqueue[qsize++%50] = *p;
                               //handlerqueue[qsize++] = h;
                               }

                       }
  //        Queue::recv(p, h);
                       else
                       {
                       Queue::recv(p,h);
                       }
               }
               }
       }
       else {
               Queue::recv(p, h);
       }
}


<http://mailman.isi.edu/pipermail/ns-users/2006-May/055634.html>

Reply via email to