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);
uint32_t m_reqNo
Route request number.
Simulation virtual time values and global simulation resolution.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
uint32_t m_maxRreqId
The unique request id for any destination.
uint32_t GetRreqCnt(Ipv4Address dst)
Get the request count number for one destination address.
std::map< Ipv4Address, std::list< ReceivedRreqEntry > > m_sourceRreqMap
The cache to ensure all the route request from unique source.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register the class in the ns-3 factory.
std::map< Ipv4Address, RreqTableEntry > m_rreqDstMap
The cache to save route request table entries indexed with destination address.
void SetIdentification(uint16_t i)
Set identification.
uint32_t m_requestIdSize
The request source id size.
The request entry for intermediate nodes to check if they have received this request or not This is u...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint32_t m_requestTableSize
The request table size.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
void RemoveLeastExpire(std::map< Ipv4Address, RreqTableEntry > &rreqDstMap)
Remove the least used entry.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
static TypeId GetTypeId()
LinkStates m_linkStates
The state of the unidirectional link.
void FindAndUpdate(Ipv4Address dst)
Find the entry in the route request queue to see if already exists.
std::vector< BlackList > m_blackList
The Black list.
void SetDestination(Ipv4Address d)
Set IPv4 address of the destination.
bool MarkLinkAsUnidirectional(Ipv4Address neighbor, Time blacklistTimeout)
Mark entry as unidirectional (e.g.
void PurgeNeighbor()
Remove all expired black list entries.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
std::map< Ipv4Address, uint32_t > m_rreqIdCache
The id cache to ensure all the ids are unique, it is used when sending out route request.
void RemoveRreqEntry(Ipv4Address dst)
Remove route request entry for dst.
static Time Now(void)
Return the "current simulation time".
BlackList * FindUnidirectional(Ipv4Address neighbor)
Verify if entry is unidirectional or not(e.g.
Ipv4 addresses are stored in host order in this class.
bool FindSourceEntry(Ipv4Address src, Ipv4Address dst, uint16_t id)
Find the source request entry in the route request queue, return false if not found.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
uint32_t GetRreqSize()
Get the request id size.
Time m_expire
Expire time.
void Invalidate()
set the unidirectional entry as QUESTIONABLE state
a base class which provides memory management and object aggregation
The route request table entries.
Check if the entry is expired or not.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
uint32_t CheckUniqueRreqId(Ipv4Address dst)
The following code generates new request id for each destination.