author | Daniel Lertpratchya <nikkipui@gmail.com> |
Fri, 13 Dec 2013 10:28:25 -0500 | |
changeset 10521 | 81a6f41319cc |
parent 10513 | 955392294191 |
child 10774 | 1f47a73ab755 |
permissions | -rw-r--r-- |
8752 | 1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2011 Yufei Cheng |
|
4 |
* |
|
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 |
|
7 |
* published by the Free Software Foundation; |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 |
* |
|
18 |
* Author: Yufei Cheng <yfcheng@ittc.ku.edu> |
|
19 |
* |
|
20 |
* James P.G. Sterbenz <jpgs@ittc.ku.edu>, director |
|
21 |
* ResiliNets Research Group http://wiki.ittc.ku.edu/resilinets |
|
22 |
* Information and Telecommunication Technology Center (ITTC) |
|
23 |
* and Department of Electrical Engineering and Computer Science |
|
24 |
* The University of Kansas Lawrence, KS USA. |
|
25 |
* |
|
26 |
* Work supported in part by NSF FIND (Future Internet Design) Program |
|
27 |
* under grant CNS-0626918 (Postmodern Internet Architecture), |
|
28 |
* NSF grant CNS-1050226 (Multilayer Network Resilience Analysis and Experimentation on GENI), |
|
29 |
* US Department of Defense (DoD), and ITTC at The University of Kansas. |
|
30 |
*/ |
|
31 |
||
32 |
#ifndef DSR_NETWORK_QUEUE_H |
|
33 |
#define DSR_NETWORK_QUEUE_H |
|
34 |
||
35 |
#include <vector> |
|
36 |
#include "ns3/ipv4-routing-protocol.h" |
|
37 |
#include "ns3/simulator.h" |
|
38 |
#include "ns3/ipv4-header.h" |
|
39 |
#include "dsr-option-header.h" |
|
40 |
||
41 |
namespace ns3 { |
|
42 |
namespace dsr { |
|
43 |
||
44 |
enum DsrMessageType |
|
45 |
{ |
|
46 |
DSR_CONTROL_PACKET = 1, |
|
47 |
DSR_DATA_PACKET = 2 |
|
48 |
}; |
|
49 |
/** |
|
50 |
* \ingroup dsr |
|
51 |
* \brief DSR Network Queue Entry |
|
52 |
*/ |
|
53 |
class DsrNetworkQueueEntry |
|
54 |
{ |
|
55 |
public: |
|
10521
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
56 |
/** |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
57 |
* Construct a DsrNetworkQueueEntry with the given parameters |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
58 |
* |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
59 |
* \param pa packet |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
60 |
* \param s IPv4 address of the source |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
61 |
* \param n IPv4 address of the next hop node |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
62 |
* \param exp expiration time |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
63 |
* \param r Route |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
64 |
*/ |
8752 | 65 |
DsrNetworkQueueEntry (Ptr<const Packet> pa = 0, Ipv4Address s = Ipv4Address (), Ipv4Address n = Ipv4Address (), |
66 |
Time exp = Simulator::Now (), Ptr<Ipv4Route> r = 0) |
|
67 |
: m_packet (pa), |
|
68 |
m_srcAddr (s), |
|
69 |
m_nextHopAddr (n), |
|
70 |
tstamp (exp), |
|
71 |
m_ipv4Route (r) |
|
72 |
{ |
|
73 |
} |
|
74 |
/** |
|
75 |
* Compare send buffer entries |
|
10521
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
76 |
* \param o |
8752 | 77 |
* \return true if equal |
78 |
*/ |
|
79 |
bool operator== (DsrNetworkQueueEntry const & o) const |
|
80 |
{ |
|
8756
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
81 |
return ((m_packet == o.m_packet) && (m_srcAddr == o.m_srcAddr) && (m_nextHopAddr == o.m_nextHopAddr) |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
82 |
&& (tstamp == o.tstamp) && (m_ipv4Route == o.m_ipv4Route)); |
8752 | 83 |
} |
84 |
||
85 |
///\name Fields |
|
86 |
//\{ |
|
8756
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
87 |
Ptr<const Packet> GetPacket () const |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
88 |
{ |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
89 |
return m_packet; |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
90 |
} |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
91 |
void SetPacket (Ptr<const Packet> p) |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
92 |
{ |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
93 |
m_packet = p; |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
94 |
} |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
95 |
Ptr<Ipv4Route> GetIpv4Route () const |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
96 |
{ |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
97 |
return m_ipv4Route; |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
98 |
} |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
99 |
void SetIpv4Route (Ptr<Ipv4Route> route) |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
100 |
{ |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
101 |
m_ipv4Route = route; |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
102 |
} |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
103 |
Ipv4Address GetSourceAddress () const |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
104 |
{ |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
105 |
return m_srcAddr; |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
106 |
} |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
107 |
void SetSourceAddress (Ipv4Address addr) |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
108 |
{ |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
109 |
m_srcAddr = addr; |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
110 |
} |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
111 |
Ipv4Address GetNextHopAddress () const |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
112 |
{ |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
113 |
return m_nextHopAddr; |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
114 |
} |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
115 |
void SetNextHopAddress (Ipv4Address addr) |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
116 |
{ |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
117 |
m_nextHopAddr = addr; |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
118 |
} |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
119 |
Time GetInsertedTimeStamp (void) const |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
120 |
{ |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
121 |
return tstamp; |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
122 |
} |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
123 |
void SetInsertedTimeStamp (Time time) |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
124 |
{ |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
125 |
tstamp = time; |
9a34e618f40b
check-style.py run on src/dsr
Tom Henderson <tomh@tomh.org>
parents:
8752
diff
changeset
|
126 |
} |
8752 | 127 |
//\} |
128 |
private: |
|
129 |
/// Data packet |
|
130 |
Ptr<const Packet> m_packet; |
|
131 |
Ipv4Address m_srcAddr; |
|
132 |
Ipv4Address m_nextHopAddr; |
|
133 |
Time tstamp; |
|
134 |
/// Ipv4Route |
|
135 |
Ptr<Ipv4Route> m_ipv4Route; |
|
136 |
}; |
|
137 |
||
138 |
class DsrNetworkQueue : public Object |
|
139 |
{ |
|
140 |
public: |
|
10513
955392294191
Changed GetTypeID to GetTypeId in dsr-network-queue.* (plus re-scan binding)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
8756
diff
changeset
|
141 |
static TypeId GetTypeId (void); |
10521
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
142 |
|
8752 | 143 |
DsrNetworkQueue (); |
10521
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
144 |
/** |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
145 |
* Construct a DsrNetworkQueue with the given |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
146 |
* maximum length and maximum delay. |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
147 |
* |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
148 |
* \param maxLen Maximum queue size |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
149 |
* \param maxDelay Maximum entry lifetime in the queue |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
150 |
*/ |
8752 | 151 |
DsrNetworkQueue (uint32_t maxLen, Time maxDelay); |
152 |
~DsrNetworkQueue (); |
|
10521
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
153 |
|
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
154 |
/** |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
155 |
* Push entry in queue, if there is no entry with the same |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
156 |
* packet and destination address in queue. |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
157 |
* |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
158 |
* \param entry packet entry |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
159 |
* \return true if the given entry was put in the queue, |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
160 |
* false otherwise |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
161 |
*/ |
8752 | 162 |
bool Enqueue (DsrNetworkQueueEntry & entry); |
10521
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
163 |
/** |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
164 |
* Return first found (the earliest) entry for given destination |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
165 |
* |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
166 |
* \param entry pointer to the return entry |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
167 |
* \return true if an entry is returned, |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
168 |
* false otherwise |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
169 |
*/ |
8752 | 170 |
bool Dequeue (DsrNetworkQueueEntry & entry); |
10521
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
171 |
/** |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
172 |
* Number of entries |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
173 |
* |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
174 |
* \return the current queue size/length |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
175 |
*/ |
8752 | 176 |
uint32_t GetSize (); |
177 |
||
10521
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
178 |
/** |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
179 |
* Set the maximum queue size |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
180 |
* |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
181 |
* \param maxSize the maximum queue size |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
182 |
*/ |
8752 | 183 |
void SetMaxNetworkSize (uint32_t maxSize); |
10521
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
184 |
/** |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
185 |
* Set the maximum entry lifetime in the queue |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
186 |
* |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
187 |
* \param delay the maximum entry lifetime |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
188 |
*/ |
8752 | 189 |
void SetMaxNetworkDelay (Time delay); |
10521
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
190 |
/** |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
191 |
* Return the maximum queue size |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
192 |
* |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
193 |
* \return the maximum queue size |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
194 |
*/ |
8752 | 195 |
uint32_t GetMaxNetworkSize (void) const; |
10521
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
196 |
/** |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
197 |
* Return the maximum entry lifetime for this queue |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
198 |
* |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
199 |
* \return the maximum entry lifetime for this queue |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
200 |
*/ |
8752 | 201 |
Time GetMaxNetworkDelay (void) const; |
10521
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
202 |
/** |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
203 |
* Clear the queue |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
204 |
*/ |
8752 | 205 |
void Flush (void); |
206 |
||
207 |
std::vector<DsrNetworkQueueEntry> & GetQueue () |
|
208 |
{ |
|
209 |
return m_dsrNetworkQueue; |
|
210 |
} |
|
211 |
||
212 |
private: |
|
10521
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
213 |
/** |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
214 |
* Clean the queue by removing entries that exceeded lifetime. |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
215 |
*/ |
8752 | 216 |
void Cleanup (void); |
10521
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
217 |
std::vector<DsrNetworkQueueEntry> m_dsrNetworkQueue; //!< Queue (vector) of entries |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
218 |
uint32_t m_size; //!< Current queue size |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
219 |
uint32_t m_maxSize; //!< Maximum queue size |
81a6f41319cc
[doxygen] dsr module (fix only trivial warnings)
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10513
diff
changeset
|
220 |
Time m_maxDelay; //!< Maximum entry lifetime |
8752 | 221 |
}; |
222 |
||
223 |
} // namespace dsr |
|
224 |
} // namespace ns3 |
|
225 |
||
226 |
#endif /* DSR_NETWORK_QUEUE_H */ |