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")
71 pointToPoint.SetChannelAttribute (
"Delay",
StringValue (
"2ms"));
74 devices = pointToPoint.Install (nodes);
80 address.
SetBase (
"10.1.1.0",
"255.255.255.0");
98 std::string traceFileName =
"netanim-test.xml";
101 NS_TEST_ASSERT_MSG_EQ (anim.GetTracePktCount (), 32,
"Expected 32 packets traced");
102 FILE * fp = fopen (traceFileName.c_str (),
"r");
103 NS_TEST_ASSERT_MSG_NE (fp, 0,
"Trace file was not created");
105 unlink (traceFileName.c_str ());
117 } g_animationInterfaceTestSuite;
holds a vector of ns3::Application pointers.
virtual ~AnimationInterfaceTestCase()
Destructor.
holds a vector of std::pair of Ptr<Ipv4> 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.
Build a set of PointToPointNetDevice objects.
void SetDeviceAttribute(std::string name, const AttributeValue &value)
TestSuite(std::string name, Type type=UNIT)
Constuct a new test suite.
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 test case to this test suite.
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...
Time Seconds(double seconds)
create ns3::Time instances in units of seconds.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> 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.
void SetAttribute(std::string name, const AttributeValue &value)
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const