48 .AddConstructor<RreqTable> ()
68 Time max = Seconds (0.0);
69 for (std::map<Ipv4Address, RreqTableEntry >::const_iterator i =
70 rreqDstMap.begin (); i != rreqDstMap.end (); ++i)
80 rreqDstMap.erase (firstExpire);
87 std::map<Ipv4Address, RreqTableEntry >::const_iterator i =
91 NS_LOG_LOGIC (
"The request table entry for " << dst <<
" not found");
107 NS_LOG_LOGIC (
"Find the request table entry for " << dst <<
", increment the request count");
120 std::map<Ipv4Address, RreqTableEntry >::const_iterator i =
137 std::map<Ipv4Address, RreqTableEntry >::const_iterator i =
160 std::map<Ipv4Address, uint32_t>::const_iterator i =
164 NS_LOG_LOGIC (
"No Request id for " << dst <<
" found, initialize it to 0");
170 NS_LOG_LOGIC (
"Request id for " << dst <<
" found in the cache");
183 NS_LOG_INFO (
"The Request id for " << dst <<
" is " << rreqId);
213 for (std::vector<BlackList>::iterator i =
m_blackList.begin ();
216 if (i->m_neighborAddress == neighbor)
230 if (i->m_neighborAddress == neighbor)
232 NS_LOG_DEBUG (
"Update the blacklist list timeout if found the blacklist entry");
233 i->m_expireTime = std::max (blacklistTimeout +
Simulator::Now (), i->m_expireTime);
260 std::list<ReceivedRreqEntry> receivedRreqEntryList;
264 std::map<Ipv4Address, std::list<ReceivedRreqEntry> >::const_iterator i =
m_sourceRreqMap.find (src);
267 NS_LOG_LOGIC (
"The source request table entry for " << src <<
" not found");
269 receivedRreqEntryList.clear ();
270 receivedRreqEntryList.push_back (rreqEntry);
277 NS_LOG_LOGIC (
"Find the request table entry for " << src <<
", check if it is exact duplicate");
281 receivedRreqEntryList = i->second;
284 receivedRreqEntryList.pop_front ();
288 for (std::list<ReceivedRreqEntry>::const_iterator j = receivedRreqEntryList.begin (); j != receivedRreqEntryList.end (); ++j)
296 receivedRreqEntryList.push_back (rreqEntry);
keep track of time values and allow control of global simulation resolution
#define NS_LOG_FUNCTION(parameters)
NS_OBJECT_ENSURE_REGISTERED(DsrFsHeader)
uint32_t GetRreqCnt(Ipv4Address dst)
std::map< Ipv4Address, std::list< ReceivedRreqEntry > > m_sourceRreqMap
std::map< Ipv4Address, RreqTableEntry > m_rreqDstMap
void SetIdentification(uint16_t i)
#define NS_LOG_COMPONENT_DEFINE(name)
uint32_t m_requestTableSize
void RemoveLeastExpire(std::map< Ipv4Address, RreqTableEntry > &rreqDstMap)
#define NS_LOG_FUNCTION_NOARGS()
static TypeId GetTypeId()
Get the type identificator.
void FindAndUpdate(Ipv4Address dst)
std::vector< BlackList > m_blackList
void SetDestination(Ipv4Address d)
bool MarkLinkAsUnidirectional(Ipv4Address neighbor, Time blacklistTimeout)
Mark entry as unidirectional (e.g. add this neighbor to "blacklist" for blacklistTimeout period) ...
virtual ~RreqTable()
Destructor.
#define NS_LOG_LOGIC(msg)
std::map< Ipv4Address, uint32_t > m_rreqIdCache
void RemoveRreqEntry(Ipv4Address dst)
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)
#define NS_LOG_DEBUG(msg)
a base class which provides memory management and object aggregation
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
uint32_t CheckUniqueRreqId(Ipv4Address dst)