OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2010 Hemanth Narra | 3 * Copyright (c) 2010 Hemanth Narra |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 namespace ns3 { | 38 namespace ns3 { |
39 | 39 |
40 NS_LOG_COMPONENT_DEFINE ("DsdvPacketQueue"); | 40 NS_LOG_COMPONENT_DEFINE ("DsdvPacketQueue"); |
41 | 41 |
42 namespace dsdv { | 42 namespace dsdv { |
43 uint32_t | 43 uint32_t |
44 PacketQueue::GetSize () | 44 PacketQueue::GetSize () |
45 { | 45 { |
46 Purge (); | 46 Purge (); |
47 return m_queue.size (); | 47 return static_cast<uint32_t> (m_queue.size ()); |
48 } | 48 } |
49 | 49 |
50 bool | 50 bool |
51 PacketQueue::Enqueue (QueueEntry & entry) | 51 PacketQueue::Enqueue (QueueEntry & entry) |
52 { | 52 { |
53 NS_LOG_FUNCTION ("Enqueing packet destined for" << entry.GetIpv4Header ().GetD
estination ()); | 53 NS_LOG_FUNCTION ("Enqueing packet destined for" << entry.GetIpv4Header ().GetD
estination ()); |
54 Purge (); | 54 Purge (); |
55 uint32_t numPacketswithdst; | 55 uint32_t numPacketswithdst; |
56 for (std::vector<QueueEntry>::const_iterator i = m_queue.begin (); i | 56 for (std::vector<QueueEntry>::const_iterator i = m_queue.begin (); i |
57 != m_queue.end (); ++i) | 57 != m_queue.end (); ++i) |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 PacketQueue::Drop (QueueEntry en, std::string reason) | 184 PacketQueue::Drop (QueueEntry en, std::string reason) |
185 { | 185 { |
186 NS_LOG_LOGIC (reason << en.GetPacket ()->GetUid () << " " << en.GetIpv4Header
().GetDestination ()); | 186 NS_LOG_LOGIC (reason << en.GetPacket ()->GetUid () << " " << en.GetIpv4Header
().GetDestination ()); |
187 // en.GetErrorCallback () (en.GetPacket (), en.GetIpv4Header (), | 187 // en.GetErrorCallback () (en.GetPacket (), en.GetIpv4Header (), |
188 // Socket::ERROR_NOROUTETOHOST); | 188 // Socket::ERROR_NOROUTETOHOST); |
189 return; | 189 return; |
190 } | 190 } |
191 | 191 |
192 } | 192 } |
193 } | 193 } |
OLD | NEW |