|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
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);
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)
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
bool RxPacket(Ptr< NetDevice > dev, Ptr< const Packet > pkt, uint16_t mode, const Address &sender)
Callback function which sets the recvdPacket parameter.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void DoRun(void)
Run the test.
TestSuite for PointToPoint module.
uint32_t CopyData(uint8_t *buffer, uint32_t size) const
Copy the packet contents to a byte buffer.
void SendOnePacket(Ptr< LrWpanPhy > sender, Ptr< LrWpanPhy > receiver)
Send one packet.
a polymophic address class
PointToPointTestSuite()
Constructor.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
Ptr< const Packet > m_recvdPacket
received packet
bool Attach(Ptr< PointToPointChannel > ch)
Attach the device to a channel.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
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...
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
virtual Address GetBroadcast(void) const
Time Seconds(double value)
Construct a Time in the indicated unit.
virtual void SetAddress(Address address)
Set the address of this interface.
PointToPointTest()
Create the test.
Test class for PointToPoint model.
static PointToPointTestSuite g_pointToPointTestSuite
The testsuite.
void SetQueue(Ptr< Queue< Packet > > queue)
Attach a queue to the PointToPointNetDevice.
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
void SendOnePacket(Ptr< PointToPointNetDevice > device, uint8_t const *buffer, uint32_t size)
Send one packet to the device specified.