20 #include "ns3/drop-tail-queue.h"
21 #include "ns3/net-device-queue-interface.h"
22 #include "ns3/point-to-point-channel.h"
23 #include "ns3/point-to-point-net-device.h"
24 #include "ns3/simulator.h"
48 void DoRun()
override;
80 const uint8_t* buffer,
84 device->Send(p, device->GetBroadcast(), 0x800);
107 devA->SetAddress(Mac48Address::Allocate());
110 devB->SetAddress(Mac48Address::Allocate());
117 uint8_t txBuffer[] =
"\"Can you tell me where my country lies?\" \\ said the unifaun to his "
118 "true love's eyes. \\ \"It lies with me!\" cried the Queen of Maybe \\ - "
119 "for her merchandise, he traded in his prize.";
120 size_t txBufferSize =
sizeof(txBuffer);
122 Simulator::Schedule(
Seconds(1.0),
139 Simulator::Destroy();
155 :
TestSuite(
"devices-point-to-point", UNIT)
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.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
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.
void AddTestCase(TestCase *testCase, TestDuration 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.
#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.
void SendOnePacket(Ptr< LrWpanPhy > sender, Ptr< LrWpanPhy > receiver)
Send one packet.
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.