20#include "ns3/boolean.h"
21#include "ns3/double.h"
22#include "ns3/dsr-fs-header.h"
23#include "ns3/dsr-helper.h"
24#include "ns3/dsr-main-helper.h"
25#include "ns3/dsr-option-header.h"
26#include "ns3/dsr-rcache.h"
27#include "ns3/dsr-rreq-table.h"
28#include "ns3/dsr-rsendbuff.h"
29#include "ns3/ipv4-address-helper.h"
30#include "ns3/ipv4-route.h"
31#include "ns3/mesh-helper.h"
33#include "ns3/simulator.h"
34#include "ns3/string.h"
36#include "ns3/uinteger.h"
61 void DoRun()
override;
82 "length of routing header is not a multiple of 4");
90 "expect the rreqHeader after fixed size header");
106 void DoRun()
override;
123 const std::vector<Ipv4Address>
nodeList{
141 p->AddHeader(header);
162 void DoRun()
override;
179 const std::vector<Ipv4Address>
nodeList{
193 p->AddHeader(header);
214 void DoRun()
override;
231 const std::vector<Ipv4Address>
nodeList{
244 h.SetSegmentsLeft(2);
250 p->AddHeader(header);
271 void DoRun()
override;
299 p->AddHeader(header);
319 void DoRun()
override;
342 p->AddHeader(header);
344 p->AddHeader(header);
364 void DoRun()
override;
391 p->AddHeader(header);
393 p->AddHeader(header);
413 void DoRun()
override;
430 std::vector<Ipv4Address>
ip{
445 ip.emplace_back(
"0.0.0.2");
451 std::vector<Ipv4Address>
ip2{
480 void DoRun()
override;
589 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.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
static constexpr auto UNIT
void AddDsrOption(const DsrOptionHeader &option)
Serialize the option, prepending pad1 or padn option as necessary.
DsrRouteCacheEntry class for entries in the route cache.
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
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
#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.