20 #include "ns3/click-internet-stack-helper.h"
21 #include "ns3/ipv4-click-routing.h"
22 #include "ns3/ipv4-l3-protocol.h"
25 #include "ns3/simple-net-device.h"
28 #include <click/simclick.h>
48 internet.SetClickFile(node,
"src/click/test/nsclick-test-lan-single-interface.click");
65 rxDev1 = CreateObject<SimpleNetDevice>();
70 uint32_t netdev_idx =
ipv4->AddInterface(rxDev1);
72 ipv4->AddAddress(netdev_idx, ipv4Addr);
73 ipv4->SetUp(netdev_idx);
84 void DoRun()
override;
88 :
TestCase(
"Test SIMCLICK_IFID_FROM_NAME")
103 click->DoInitialize();
134 void DoRun()
override;
138 :
TestCase(
"Test SIMCLICK_IPADDR_FROM_NAME")
157 click->DoInitialize();
159 char* buf =
new char[255];
167 "eth0 has Mac Address 00:00:00:00:00:01");
175 "eth0 has Mac Address 00:00:00:00:00:02");
198 void DoRun()
override;
202 :
TestCase(
"Test SIMCLICK_GET_NODE_NAME and SIMCLICK_IF_READY")
217 click->SetNodeName(
"myNode");
218 click->DoInitialize();
221 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
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
@ UNIT
This test suite implements a Unit Test.
#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.
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.
int simclick_sim_command(simclick_node_t *simnode, int cmd,...)
Every class exported by the ns3 library is enclosed in the ns3 namespace.