7#include "ns3/ipv4-address-generator.h"
8#include "ns3/ipv4-address-helper.h"
9#include "ns3/simulator.h"
25 void DoRun()
override;
30 :
TestCase(
"Make sure the network allocator part is working on some common network prefixes.")
48 h.
SetBase(
"1.0.0.0",
"255.0.0.0");
54 h.
SetBase(
"0.1.0.0",
"255.255.0.0");
60 h.
SetBase(
"0.0.1.0",
"255.255.255.0");
78 void DoRun()
override;
83 :
TestCase(
"Make sure the address allocator part is working")
101 h.
SetBase(
"1.0.0.0",
"255.0.0.0",
"0.0.0.3");
107 h.
SetBase(
"0.1.0.0",
"255.255.0.0",
"0.0.0.3");
113 h.
SetBase(
"0.0.1.0",
"255.255.255.0",
"0.0.0.3");
129 void DoRun()
override;
134 :
TestCase(
"Make sure the reset to base behavior is working")
150 h.
SetBase(
"1.0.0.0",
"255.0.0.0",
"0.0.0.3");
160 h.
SetBase(
"0.1.0.0",
"255.255.0.0",
"0.0.0.3");
170 h.
SetBase(
"0.0.1.0",
"255.255.255.0",
"0.0.0.3");
200 void DoRun()
override;
205 :
TestCase(
"IpAddressHelper Ipv4 test case (similar to IPv6)")
222 ip1.
SetBase(
"192.168.0.0",
"255.255.255.0");
239 ip1.
SetBase(
"192.168.0.0",
"255.255.255.0",
"0.0.0.100");
244 ip1.
SetBase(
"192.168.0.0",
"255.255.255.0",
"0.0.0.254");
IPv4 address allocator helper Test.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
void DoRun() override
Implementation to actually run this TestCase.
AddressAllocatorHelperTestCase()
IPv4 address helper Test.
~IpAddressHelperTestCasev4() override
IpAddressHelperTestCasev4()
void DoRun() override
Implementation to actually run this TestCase.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
IPv4 Address Helper TestSuite.
Ipv4AddressHelperTestSuite()
IPv4 network allocator helper Test.
void DoRun() override
Implementation to actually run this TestCase.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
NetworkAllocatorHelperTestCase()
IPv4 reset allocator helper Test.
void DoRun() override
Implementation to actually run this TestCase.
ResetAllocatorHelperTestCase()
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
static void Reset()
Reset the networks and Ipv4Address to zero.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Ipv4Address NewAddress()
Increment the IP address counter used to allocate IP addresses.
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Ipv4Address NewNetwork()
Increment the network number and reset the IP address counter to the base value provided in the SetBa...
Ipv4 addresses are stored in host order in this class.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
#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.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
static Ipv4AddressHelperTestSuite g_ipv4AddressHelperTestSuite
Static variable for test initialization.
Every class exported by the ns3 library is enclosed in the ns3 namespace.