|
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<DsrMaintainBuffEntry>::const_iterator i =
m_maintainBuffer.begin (); i
64 if ((i->GetNextHop () == entry.
GetNextHop ()) && (i->GetOurAdd () == entry.
GetOurAdd ()) && (i->GetSrc () == entry.
GetSrc ())
65 && (i->GetDst () == entry.
GetDst ()) && (i->GetAckId () == entry.
GetAckId ()) && (i->GetSegsLeft () == entry.
GetSegsLeft ()))
87 NS_LOG_INFO (
"Drop Packet With next hop " << nextHop);
90 { return en.GetNextHop () == nextHop; });
100 if (i->GetNextHop () == nextHop)
114 for (std::vector<DsrMaintainBuffEntry>::const_iterator i =
m_maintainBuffer.begin (); i
117 if (i->GetNextHop () == nextHop)
119 NS_LOG_DEBUG (
"Found the packet in maintenance buffer");
129 for (std::vector<DsrMaintainBuffEntry>::iterator i =
m_maintainBuffer.begin (); i
137 && (i->GetSrc () == entry.
GetSrc ()) && (i->GetDst () == entry.
GetDst ())
150 for (std::vector<DsrMaintainBuffEntry>::iterator i =
m_maintainBuffer.begin (); i
158 && (i->GetSrc () == entry.
GetSrc ()) && (i->GetDst () == entry.
GetDst ())
159 && (i->GetAckId () == entry.
GetAckId ()))
172 for (std::vector<DsrMaintainBuffEntry>::iterator i =
m_maintainBuffer.begin (); i
180 if ((i->GetSrc () == entry.
GetSrc ()) && (i->GetDst () == entry.
GetDst ())
195 for (std::vector<DsrMaintainBuffEntry>::iterator i =
m_maintainBuffer.begin (); i
203 if ((i->GetSrc () == entry.
GetSrc ()) && (i->GetDst () == entry.
GetDst ()) && (i->GetOurAdd () == entry.
GetOurAdd ())
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time m_maintainBufferTimeout
The maximum period of time that a routing protocol is allowed to buffer a packet for,...
Time GetExpireTime() const
Get expiration time.
std::vector< DsrMaintainBuffEntry > m_maintainBuffer
The vector of maintain buffer entries.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
bool Dequeue(Ipv4Address dst, DsrMaintainBuffEntry &entry)
Return first found (the earliest) entry for given destination.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool LinkEqual(DsrMaintainBuffEntry &entry)
Verify if the maintain buffer entry is the same in every field for link ack.
uint32_t GetSize()
Number of entries.
Ipv4 addresses are stored in host order in this class.
bool Enqueue(DsrMaintainBuffEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue.
DSR Maintain Buffer Entry.
bool operator()(DsrErrorBuffEntry const &e) const
comparison operator
Ipv4Address GetNextHop() const
Get next hop of entry.
Ptr< const Packet > GetPacket() const
Get packet.
Ipv4Address GetSrc() const
Get source address.
void DropPacketWithNextHop(Ipv4Address nextHop)
Remove all packets with next hop IP address dst.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Ipv4Address GetDst() const
Get destination address.
bool AllEqual(DsrMaintainBuffEntry &entry)
Verify if all the elements in the maintenance buffer entry is the same.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
bool Find(Ipv4Address nextHop)
Finds whether a packet with next hop dst exists in the queue.
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 ",...
bool PromiscEqual(DsrMaintainBuffEntry &entry)
Verify if the maintain buffer entry is the same in every field for promiscuous ack.
bool NetworkEqual(DsrMaintainBuffEntry &entry)
Verify if the maintain buffer entry is the same in every field for network ack.
void SetExpireTime(Time exp)
Set expiration time.
uint32_t m_maxLen
The maximum number of packets that we allow a routing protocol to buffer.
uint8_t GetSegsLeft() const
Get segments left.
void Purge()
Remove all expired entries.
Ipv4Address GetOurAdd() const
Get local address of entry.
uint16_t GetAckId() const
Get acknowledge ID.