9#include "ns3/drop-tail-queue.h"
10#include "ns3/net-device-queue-interface.h"
11#include "ns3/point-to-point-channel.h"
12#include "ns3/point-to-point-net-device.h"
13#include "ns3/simulator.h"
37 void DoRun()
override;
69 const uint8_t* buffer,
73 device->Send(p, device->GetBroadcast(), 0x800);
95 devA->Attach(channel);
98 devB->Attach(channel);
106 uint8_t txBuffer[] =
"\"Can you tell me where my country lies?\" \\ said the unifaun to his "
107 "true love's eyes. \\ \"It lies with me!\" cried the Queen of Maybe \\ - "
108 "for her merchandise, he traded in his prize.";
109 size_t txBufferSize =
sizeof(txBuffer);
Test class for PointToPoint model.
void SendOnePacket(Ptr< PointToPointNetDevice > device, const uint8_t *buffer, uint32_t size)
Send one packet to the device specified.
PointToPointTest()
Create the test.
void DoRun() override
Run the test.
bool RxPacket(Ptr< NetDevice > dev, Ptr< const Packet > pkt, uint16_t mode, const Address &sender)
Callback function which sets the recvdPacket parameter.
Ptr< const Packet > m_recvdPacket
received packet
TestSuite for PointToPoint module.
PointToPointTestSuite()
Constructor.
a polymophic address class
A FIFO packet queue that drops tail-end packets on overflow.
static Mac48Address Allocate()
Allocate a new Mac48Address.
uint32_t GetSize() const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
uint32_t CopyData(uint8_t *buffer, uint32_t size) const
Copy the packet contents to a byte buffer.
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.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
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.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
static PointToPointTestSuite g_pointToPointTestSuite
The testsuite.