22 #include "ns3/simulator.h"
23 #include "ns3/uinteger.h"
24 #include "ns3/traced-callback.h"
25 #include "ns3/packet.h"
26 #include "ns3/packet-socket-helper.h"
27 #include "ns3/packet-socket-client.h"
28 #include "ns3/packet-socket-server.h"
29 #include "ns3/simple-net-device.h"
30 #include "ns3/simple-channel.h"
41 virtual void DoRun (
void);
48 :
TestCase (
"Packet Socket Apps test")
78 txDev = CreateObject<SimpleNetDevice> ();
82 rxDev = CreateObject<SimpleNetDevice> ();
110 Simulator::Destroy ();
virtual Address GetAddress(void) const
uint32_t AddApplication(Ptr< Application > application)
Associate an Application to this Node.
void SetLocal(PacketSocketAddress addr)
set the local address and protocol to be used
PacketSocketAppsTestSuite g_packetSocketAppsTestSuite
PacketSocketAppsTestSuite()
an address for a packet socket
virtual void DoRun(void)
Implementation to actually run this TestCase.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
uint32_t m_receivedPacketNumber
Give ns3::PacketSocket powers to ns3::Node.
void SetSingleDevice(uint32_t device)
Set the address to match only a specified NetDevice.
a polymophic address class
virtual void SetNode(Ptr< Node > node)
Hold an unsigned integer type.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
void SetPhysicalAddress(const Address address)
Set the destination address.
keep track of a set of node pointers.
void Install(Ptr< Node > node) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
void SetRemote(PacketSocketAddress addr)
set the remote address and protocol to be used
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
uint32_t m_receivedPacketSize
void SetProtocol(uint16_t protocol)
Set the protocol.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
This test suite implements a Unit Test.
void ReceivePkt(Ptr< const Packet > packet, const Address &from)
void SetChannel(Ptr< SimpleChannel > channel)
Attach a channel to this net device.
void SetAttribute(std::string name, const AttributeValue &value)
virtual uint32_t GetIfIndex(void) const