7#include "ns3/ipv4-address-generator.h"
8#include "ns3/simulation-singleton.h"
22 void DoRun()
override;
27 :
TestCase(
"Make sure the network number allocator is working on some of network prefixes.")
84 void DoRun()
override;
89 :
TestCase(
"Sanity check on allocation of addresses")
139 void DoRun()
override;
144 :
TestCase(
"Make sure Network and address allocation play together.")
212 void DoRun()
override;
217 :
TestCase(
"A quick kindof-semi-almost-real example")
270 void DoRun()
override;
275 :
TestCase(
"Make sure that the address collision logic works.")
IPv4 address allocator Test.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
AddressAllocatorTestCase()
void DoRun() override
Implementation to actually run this TestCase.
IPv4 address collision Test.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
AddressCollisionTestCase()
void DoRun() override
Implementation to actually run this TestCase.
IPv4 AddressGenerator example (sort of) Test.
void DoRun() override
Implementation to actually run this TestCase.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
ExampleAddressGeneratorTestCase()
IPv4 Address Generator TestSuite.
Ipv4AddressGeneratorTestSuite()
IPv4 network and address allocator Test.
NetworkAndAddressTestCase()
void DoRun() override
Implementation to actually run this TestCase.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
IPv4 network number Test.
void DoRun() override
Implementation to actually run this TestCase.
NetworkNumberAllocatorTestCase()
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
static Ipv4Address NextAddress(const Ipv4Mask mask)
Allocate the next Ipv4Address for the configured network and mask.
static void InitAddress(const Ipv4Address addr, const Ipv4Mask mask)
Set the address for the given mask.
static void TestMode()
Used to turn off fatal errors and assertions, for testing.
static Ipv4Address NextNetwork(const Ipv4Mask mask)
Get the next network according to the given Ipv4Mask.
static void Reset()
Reset the networks and Ipv4Address to zero.
static bool AddAllocated(const Ipv4Address addr)
Add the Ipv4Address to the list of IPv4 entries.
static bool IsAddressAllocated(const Ipv4Address addr)
Check the Ipv4Address allocation in the list of IPv4 entries.
static Ipv4Address GetNetwork(const Ipv4Mask mask)
Get the current network of the given Ipv4Mask.
static void Init(const Ipv4Address net, const Ipv4Mask mask, const Ipv4Address addr="0.0.0.1")
Initialise the base network, mask and address for the generator.
Ipv4 addresses are stored in host order in this class.
a class to represent an Ipv4 address mask
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_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
static Ipv4AddressGeneratorTestSuite g_ipv4AddressGeneratorTestSuite
Static variable for test initialization.
Every class exported by the ns3 library is enclosed in the ns3 namespace.