22 #include "ns3/core-module.h"
23 #include "ns3/network-module.h"
24 #include "ns3/internet-module.h"
25 #include "ns3/point-to-point-module.h"
26 #include "ns3/netanim-module.h"
27 #include "ns3/applications-module.h"
28 #include "ns3/point-to-point-layout-module.h"
54 TestCase (
"Verify AnimationInterface")
70 pointToPoint.SetDeviceAttribute (
"DataRate",
StringValue (
"5Mbps"));
71 pointToPoint.SetChannelAttribute (
"Delay",
StringValue (
"2ms"));
74 devices = pointToPoint.Install (nodes);
80 address.
SetBase (
"10.1.1.0",
"255.255.255.0");
87 serverApps.
Start (Seconds (1.0));
88 serverApps.
Stop (Seconds (10.0));
96 clientApps.
Start (Seconds (2.0));
97 clientApps.
Stop (Seconds (10.0));
98 std::string traceFileName =
"netanim-test.xml";
102 FILE * fp = fopen (traceFileName.c_str (),
"r");
105 unlink (traceFileName.c_str ());
holds a vector of ns3::Application pointers.
virtual ~AnimationInterfaceTestCase()
Destructor.
ns3::AnimationInterfaceTestSuite g_animationInterfaceTestSuite
holds a vector of std::pair of Ptr and interface index.
hold variables of type string
create an application which sends a udp packet and waits for an echo of this packet ...
aggregate IP/TCP/UDP functionality to existing Nodes.
#define NS_TEST_ASSERT_MSG_NE(actual, limit, msg)
Test that an actual and expected (limit) value are not equal and report and abort if not...
Build a set of PointToPointNetDevice objects.
ApplicationContainer Install(Ptr< Node > node) const
static void SetConstantPosition(Ptr< Node > n, double x, double y, double z=0)
Helper function to set Constant Position for a given node.
Create a server application which waits for input udp packets and sends them back to the original sen...
hold objects of type ns3::Time
AnimationInterfaceTestCase()
Constructor.
Hold an unsigned integer type.
holds a vector of ns3::NetDevice pointers
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter...
static void Destroy(void)
virtual void DoRun(void)
Run unit tests for this class.
keep track of a set of node pointers.
void Install(std::string nodeName) const
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter...
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
Interface to network animator.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
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 SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
AnimationInterfaceTestSuite()