9#include "ns3/packet-socket-client.h"
10#include "ns3/packet-socket-helper.h"
11#include "ns3/packet-socket-server.h"
12#include "ns3/packet.h"
13#include "ns3/simple-channel.h"
14#include "ns3/simple-net-device.h"
15#include "ns3/simulator.h"
17#include "ns3/traced-callback.h"
18#include "ns3/uinteger.h"
34 void DoRun()
override;
46 :
TestCase(
"Packet Socket Apps test")
84 txDev->SetChannel(channel);
85 rxDev->SetChannel(channel);
95 client->SetRemote(socketAddr);
102 server->SetLocal(socketAddr);
PacketSocket apps Unit Test.
uint32_t m_receivedPacketSize
Received packet size.
void DoRun() override
Implementation to actually run this TestCase.
uint32_t m_receivedPacketNumber
Number of received packets.
void ReceivePkt(Ptr< const Packet > packet, const Address &from)
Receive a packet.
PacketSocket apps TestSuite.
PacketSocketAppsTestSuite()
a polymophic address class
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
uint32_t AddApplication(Ptr< Application > application)
Associate an Application to this Node.
an address for a packet socket
void SetProtocol(uint16_t protocol)
Set the protocol.
void SetPhysicalAddress(const Address address)
Set the destination address.
void SetSingleDevice(uint32_t device)
Set the address to match only a specified NetDevice.
Give ns3::PacketSocket powers to ns3::Node.
void Install(Ptr< Node > node) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
Smart pointer class similar to boost::intrusive_ptr.
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
Hold an unsigned integer type.
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.
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 PacketSocketAppsTestSuite g_packetSocketAppsTestSuite
Static variable for test initialization.