22#include "ns3/drop-tail-queue.h"
23#include "ns3/simulator.h"
24#include "ns3/point-to-point-net-device.h"
25#include "ns3/point-to-point-channel.h"
26#include "ns3/net-device-queue-interface.h"
49 virtual void DoRun (
void);
84 device->Send (p, device->GetBroadcast (), 0x800);
105 devA->SetAddress (Mac48Address::Allocate ());
108 devB->SetAddress (Mac48Address::Allocate ());
116 uint8_t txBuffer [] =
"\"Can you tell me where my country lies?\" \\ said the unifaun to his true love's eyes. \\ \"It lies with me!\" cried the Queen of Maybe \\ - for her merchandise, he traded in his prize.";
117 size_t txBufferSize =
sizeof(txBuffer);
125 uint8_t rxBuffer [1500];
130 Simulator::Destroy ();
146 :
TestSuite (
"devices-point-to-point", UNIT)
Test class for PointToPoint model.
PointToPointTest()
Create the test.
void SendOnePacket(Ptr< PointToPointNetDevice > device, uint8_t const *buffer, uint32_t size)
Send one packet to the device specified.
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
virtual void DoRun(void)
Run the test.
TestSuite for PointToPoint module.
PointToPointTestSuite()
Constructor.
a polymophic address class
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
uint32_t CopyData(uint8_t *buffer, uint32_t size) const
Copy the packet contents to a byte buffer.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
static PointToPointTestSuite g_pointToPointTestSuite
The testsuite.