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