31 #include "ns3/boolean.h"
32 #include "ns3/double.h"
33 #include "ns3/dsr-fs-header.h"
34 #include "ns3/dsr-helper.h"
35 #include "ns3/dsr-main-helper.h"
36 #include "ns3/dsr-option-header.h"
37 #include "ns3/dsr-rcache.h"
38 #include "ns3/dsr-rreq-table.h"
39 #include "ns3/dsr-rsendbuff.h"
40 #include "ns3/ipv4-address-helper.h"
41 #include "ns3/ipv4-route.h"
42 #include "ns3/mesh-helper.h"
44 #include "ns3/simulator.h"
45 #include "ns3/string.h"
47 #include "ns3/uinteger.h"
72 void DoRun()
override;
93 "length of routing header is not a multiple of 4");
101 "expect the rreqHeader after fixed size header");
117 void DoRun()
override;
134 const std::vector<Ipv4Address> nodeList{
173 void DoRun()
override;
190 const std::vector<Ipv4Address> nodeList{
225 void DoRun()
override;
242 const std::vector<Ipv4Address> nodeList{
282 void DoRun()
override;
330 void DoRun()
override;
375 void DoRun()
override;
424 void DoRun()
override;
441 std::vector<Ipv4Address> ip{
456 ip.emplace_back(
"0.0.0.2");
462 std::vector<Ipv4Address> ip2{
491 void DoRun()
override;
558 Simulator::Destroy();
600 void DoRun()
override;
Unit test for DSR route cache entry.
~DsrCacheEntryTest() override
void DoRun() override
Implementation to actually run this TestCase.
Unit test for DSR routing table entry.
void DoRun() override
Implementation to actually run this TestCase.
~DsrRreqTableTest() override
Unit test for Send Buffer.
void CheckSizeLimit()
Check size limit function.
void CheckTimeout()
Check timeout function.
dsr::DsrSendBuffer q
send buffer
~DsrSendBuffTest() override
void DoRun() override
Implementation to actually run this TestCase.
automatically resized byte buffer
void AddAtStart(uint32_t start)
Buffer::Iterator Begin() const
const uint8_t * PeekData() const
Ipv4 addresses are stored in host order in this class.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
void AddHeader(const Header &header)
Add header to this packet.
void RemoveAtStart(uint32_t size)
Remove size bytes from the start of the current packet.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
@ UNIT
This test suite implements a Unit Test.
void AddDsrOption(const DsrOptionHeader &option)
Serialize the option, prepending pad1 or padn option as necessary.
DsrRouteCacheEntry class for entries in the route cache.
IP_VECTOR GetVector() const
Get the IP vector.
void SetDestination(Ipv4Address d)
Set destination address.
Ipv4Address GetDestination() const
Get destination address.
Time GetExpireTime() const
Get expire time.
void SetExpireTime(Time exp)
Set expire time.
void SetVector(IP_VECTOR v)
Sets the IP vector.
void SetMaxQueueLen(uint32_t len)
Set the maximum queue length.
Time GetSendBufferTimeout() const
Return the entry lifetime in the queue.
uint32_t GetSize()
Number of entries.
bool Dequeue(Ipv4Address dst, DsrSendBuffEntry &entry)
Return first found (the earliest) entry for the given destination.
uint32_t GetMaxQueueLen() const
Return the maximum queue length.
void SetSendBufferTimeout(Time t)
Set the entry lifetime in the queue.
bool Enqueue(DsrSendBuffEntry &entry)
Push entry in queue, if there is no entry with the same packet and destination address in queue.
bool Find(Ipv4Address dst)
Check if a packet with destination dst exists in the queue.
void DropPacketWithDst(Ipv4Address dst)
Remove all packets with destination IP address dst.
DsrTestSuite g_dsrTestSuite
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
The route request table entries.
uint32_t m_reqNo
Route request number.