9#include "ns3/click-internet-stack-helper.h"
10#include "ns3/ipv4-click-routing.h"
11#include "ns3/ipv4-l3-protocol.h"
14#include "ns3/simple-net-device.h"
17#include <click/simclick.h>
43 internet.SetClickFile(node,
"src/click/test/nsclick-test-lan-single-interface.click");
44 internet.Install(node);
63 node->AddDevice(rxDev1);
66 uint32_t netdev_idx = ipv4->AddInterface(rxDev1);
68 ipv4->AddAddress(netdev_idx, ipv4Addr);
69 ipv4->SetUp(netdev_idx);
80 void DoRun()
override;
84 :
TestCase(
"Test SIMCLICK_IFID_FROM_NAME")
99 click->DoInitialize();
130 void DoRun()
override;
134 :
TestCase(
"Test SIMCLICK_IPADDR_FROM_NAME")
153 click->DoInitialize();
155 char* buf =
new char[255];
163 "eth0 has Mac Address 00:00:00:00:00:01");
171 "eth0 has Mac Address 00:00:00:00:00:02");
194 void DoRun()
override;
198 :
TestCase(
"Test SIMCLICK_GET_NODE_NAME and SIMCLICK_IF_READY")
213 click->SetNodeName(
"myNode");
214 click->DoInitialize();
217 char* buf =
new char[255];
Click interface ID from name test.
void DoRun() override
Implementation to actually run this TestCase.
Click interface ID from name test.
ClickIfidFromNameTestSuite()
Click IP MAC address from name test.
ClickIpMacAddressFromNameTest()
void DoRun() override
Implementation to actually run this TestCase.
void DoRun() override
Implementation to actually run this TestCase.
aggregate Click/IP/TCP/UDP functionality to existing Nodes.
Ipv4 addresses are stored in host order in this class.
Access to the IPv4 forwarding table, interfaces, and configuration.
a class to store IPv4 address information on an interface
a class to represent an Ipv4 address mask
Smart pointer class similar to boost::intrusive_ptr.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
static constexpr auto UNIT
static void AddNetworkDevice(Ptr< Node > node, Mac48Address macaddr, Ipv4Address ipv4addr, Ipv4Mask ipv4mask)
Add network device.
static void AddClickInternetStack(Ptr< Node > node)
Add Click Internet stack.
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.
static ClickIfidFromNameTestSuite g_ipv4ClickRoutingTestSuite
Static variable for test initialization.
int simclick_sim_command(simclick_node_t *simnode, int cmd,...)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.