src/devices/wifi/wifi-mac-queue.cc
changeset 5959 66bc2d3da45f
parent 5952 0588b01cd77e
child 5962 65fbfd43d8e7
equal deleted inserted replaced
5958:dd0accd82659 5959:66bc2d3da45f
   272   Time now = Simulator::Now ();
   272   Time now = Simulator::Now ();
   273   m_queue.push_front (Item (packet, hdr, now));
   273   m_queue.push_front (Item (packet, hdr, now));
   274   m_size++;
   274   m_size++;
   275 }
   275 }
   276 
   276 
       
   277 uint32_t
       
   278 WifiMacQueue::GetNPacketsByTidAndAddress (uint8_t tid, WifiMacHeader::AddressType type,
       
   279                                           Mac48Address addr)
       
   280 {
       
   281   Cleanup ();
       
   282   uint32_t nPackets = 0;
       
   283   if (!m_queue.empty ())
       
   284     {
       
   285       PacketQueueI it;
       
   286       NS_ASSERT (type <= 4);
       
   287       for (it = m_queue.begin (); it != m_queue.end (); it++)
       
   288         {
       
   289           if (GetAddressForPacket (type, it) == addr)
       
   290             {
       
   291               if (it->hdr.IsQosData () && it->hdr.GetQosTid () == tid)
       
   292                 {
       
   293                   nPackets++;
       
   294                 }
       
   295             }
       
   296         }
       
   297     }
       
   298   return nPackets;
       
   299 }
       
   300 
   277 } // namespace ns3
   301 } // namespace ns3