LEFT | RIGHT |
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) 2009 IITP RAS | 3 * Copyright (c) 2009 IITP RAS |
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 19 matching lines...) Expand all Loading... |
30 #include <functional> | 30 #include <functional> |
31 #include "ns3/ipv4-route.h" | 31 #include "ns3/ipv4-route.h" |
32 #include "ns3/socket.h" | 32 #include "ns3/socket.h" |
33 #include "ns3/log.h" | 33 #include "ns3/log.h" |
34 | 34 |
35 namespace ns3 { | 35 namespace ns3 { |
36 | 36 |
37 NS_LOG_COMPONENT_DEFINE ("AodvRequestQueue"); | 37 NS_LOG_COMPONENT_DEFINE ("AodvRequestQueue"); |
38 | 38 |
39 namespace aodv { | 39 namespace aodv { |
40 uint32_t | 40 |
| 41 std::size_t |
41 RequestQueue::GetSize () | 42 RequestQueue::GetSize () |
42 { | 43 { |
43 Purge (); | 44 Purge (); |
44 return static_cast<uint32_t>(m_queue.size ()); | 45 return m_queue.size (); |
45 } | 46 } |
46 | 47 |
47 bool | 48 bool |
48 RequestQueue::Enqueue (QueueEntry & entry) | 49 RequestQueue::Enqueue (QueueEntry & entry) |
49 { | 50 { |
50 Purge (); | 51 Purge (); |
51 for (std::vector<QueueEntry>::const_iterator i = m_queue.begin (); i | 52 for (std::vector<QueueEntry>::const_iterator i = m_queue.begin (); i |
52 != m_queue.end (); ++i) | 53 != m_queue.end (); ++i) |
53 { | 54 { |
54 if ((i->GetPacket ()->GetUid () == entry.GetPacket ()->GetUid ()) | 55 if ((i->GetPacket ()->GetUid () == entry.GetPacket ()->GetUid ()) |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 RequestQueue::Drop (QueueEntry en, std::string reason) | 154 RequestQueue::Drop (QueueEntry en, std::string reason) |
154 { | 155 { |
155 NS_LOG_LOGIC (reason << en.GetPacket ()->GetUid () << " " << en.GetIpv4Header
().GetDestination ()); | 156 NS_LOG_LOGIC (reason << en.GetPacket ()->GetUid () << " " << en.GetIpv4Header
().GetDestination ()); |
156 en.GetErrorCallback () (en.GetPacket (), en.GetIpv4Header (), | 157 en.GetErrorCallback () (en.GetPacket (), en.GetIpv4Header (), |
157 Socket::ERROR_NOROUTETOHOST); | 158 Socket::ERROR_NOROUTETOHOST); |
158 return; | 159 return; |
159 } | 160 } |
160 | 161 |
161 } // namespace aodv | 162 } // namespace aodv |
162 } // namespace ns3 | 163 } // namespace ns3 |
LEFT | RIGHT |