|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
35 #include "ns3/ipv4-route.h"
36 #include "ns3/socket.h"
56 for (std::vector<DsrErrorBuffEntry>::const_iterator i =
m_errorBuffer.begin (); i
60 <<
" next hop " << i->GetNextHop () <<
" " << entry.
GetNextHop () <<
" dst " << i->GetDestination () <<
" " << entry.
GetDestination ());
89 std::vector<Ipv4Address>
list;
90 list.push_back (source);
91 list.push_back (nextHop);
92 const std::vector<Ipv4Address> link =
list;
96 for (std::vector<DsrErrorBuffEntry>::iterator i =
m_errorBuffer.begin (); i
99 if ((i->GetSource () == link[0]) && (i->GetNextHop () == link[1]))
101 DropLink (*i,
"DropPacketForErrLink");
106 { return (en.GetSource () == link[0]) && (en.GetNextHop () == link[1]); });
119 if (i->GetDestination () == dst)
136 for (std::vector<DsrErrorBuffEntry>::const_iterator i =
m_errorBuffer.begin (); i
139 if (i->GetDestination () == dst)
172 for (std::vector<DsrErrorBuffEntry>::iterator i =
m_errorBuffer.begin (); i
178 Drop (*i,
"Drop out-dated packet ");
Ipv4Address GetNextHop() const
Get next hop.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void Purge()
Remove all expired entries.
Ipv4Address GetDestination() const
Get destination address.
void DropLink(DsrErrorBuffEntry en, std::string reason)
Notify that packet is dropped from queue by link error.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Ptr< const Packet > GetPacket() const
Get packet from entry.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetExpireTime(Time exp)
Set expire time.
Ipv4 addresses are stored in host order in this class.
bool Dequeue(Ipv4Address dst, DsrErrorBuffEntry &entry)
Return first found (the earliest) entry for given destination.
uint32_t m_maxLen
The maximum number of packets that we allow a routing protocol to buffer.
bool operator()(DsrErrorBuffEntry const &e) const
comparison operator
Time m_errorBufferTimeout
The maximum period of time that a routing protocol is allowed to buffer a packet for,...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
uint32_t GetSize()
Returns the number of entries in the queue.
void Drop(DsrErrorBuffEntry en, std::string reason)
Notify that packet is dropped from queue by timeout.
Ipv4Address GetSource() const
Get source address.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
void DropPacketForErrLink(Ipv4Address source, Ipv4Address nextHop)
Remove all packets with the error link.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Time Seconds(double value)
Construct a Time in the indicated unit.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
std::vector< DsrErrorBuffEntry > m_errorBuffer
The send buffer to cache unsent packet.
bool Find(Ipv4Address dst)
Finds whether a packet with destination dst exists in the queue.
Time GetExpireTime() const
Get expire time.
bool Enqueue(DsrErrorBuffEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue.
uint64_t GetUid(void) const
Returns the packet's Uid.