32 #ifndef DSR_RREQ_TABLE_H
33 #define DSR_RREQ_TABLE_H
35 #include "ns3/simulator.h"
36 #include "ns3/timer.h"
37 #include "ns3/ipv4-address.h"
38 #include "ns3/callback.h"
56 LinkStates m_linkStates;
59 : m_neighborAddress (ip),
61 m_linkStates (PROBABLE)
92 return ((m_destination == o.m_destination) && (m_identification == o.m_identification)
105 Ipv4Address GetSource ()
const
109 void SetSource (Ipv4Address s)
113 uint16_t GetIdentification ()
const
115 return m_identification;
117 void SetIdentification (uint16_t i)
119 m_identification = i;
121 void SetExpireTime (Time exp)
125 Time GetExpireTime ()
const
131 Ipv4Address m_destination;
132 Ipv4Address m_source;
133 uint16_t m_identification;
161 void SetInitHopLimit (uint32_t hl)
165 uint32_t GetInitHopLimit ()
const
167 return m_initHopLimit;
169 void SetRreqTableSize (uint32_t rt)
171 m_requestTableSize = rt;
173 uint32_t GetRreqTableSize ()
const
175 return m_requestTableSize;
177 void SetRreqIdSize (uint32_t
id)
179 m_requestIdSize = id;
181 uint32_t GetRreqIdSize ()
const
183 return m_requestIdSize;
185 void SetUniqueRreqIdSize (uint32_t uid)
189 uint32_t GetUniqueRreqIdSize ()
const
196 void RemoveLeastExpire (std::map<Ipv4Address, RreqTableEntry > & rreqDstMap);
210 uint32_t GetRreqSize ();
230 void PurgeNeighbor ();
243 uint32_t MaxRequestRexmt;
245 Time MaxRequestPeriod;
249 Time NonpropRequestTimeout;
251 Time m_rreqEntryExpire;
253 uint32_t m_initHopLimit;
255 uint32_t m_requestTableSize;
257 uint32_t m_requestIdSize;
259 uint32_t m_maxRreqId;
261 LinkStates m_linkStates;
263 std::list<ReceivedRreqEntry> m_sourceRequests;
265 std::map<Ipv4Address, uint32_t> m_rreqIdCache;
267 std::map<Ipv4Address, RreqTableEntry > m_rreqDstMap;
269 std::map<Ipv4Address, std::list<ReceivedRreqEntry> > m_sourceRreqMap;
272 std::vector<BlackList> m_blackList;
276 bool operator() (
const struct BlackList & b)
const
static TypeId GetTypeId()
Get the type identificator.
bool MarkLinkAsUnidirectional(Ipv4Address neighbor, Time blacklistTimeout)
Mark entry as unidirectional (e.g. add this neighbor to "blacklist" for blacklistTimeout period) ...
virtual ~RreqTable()
Destructor.
bool operator==(ReceivedRreqEntry const &o) const
Compare send buffer entries.
maintain list of RreqTable entry
BlackList * FindUnidirectional(Ipv4Address neighbor)
Verify if entry is unidirectional or not(e.g. add this neighbor to "blacklist" for blacklistTimeout p...
Ipv4 addresses are stored in host order in this class.
bool FindSourceEntry(Ipv4Address src, Ipv4Address dst, uint16_t id)
a base class which provides memory management and object aggregation
a unique identifier for an interface.
uint32_t CheckUniqueRreqId(Ipv4Address dst)