8#include "ns3/ipv6-address-generator.h"
9#include "ns3/simulation-singleton.h"
23 void DoRun()
override;
28 :
TestCase(
"Make sure the network number allocator is working on some of network prefixes.")
47 "network should equal the initialized network for given prefix");
57 "network should equal the initialized network for given prefix");
67 "network should equal the initialized network for given prefix");
83 void DoRun()
override;
88 :
TestCase(
"Sanity check on allocation of addresses")
101 "address should equal the initialized address for given prefix");
106 "address should equal the initialized address for given prefix");
110 "address should equal the initialized address for given prefix");
114 "address should equal the initialized address for given prefix");
118 "address should equal the initialized address for given prefix");
124 "address should equal initialized address for given prefix");
145 void DoRun()
override;
150 :
TestCase(
"Make sure Network and address allocation play together.")
171 "address should equal initialized address for given prefix");
175 "address should equal next address for given prefix");
180 "address should equal next address for given prefix");
184 "address should equal next address for given prefix");
198 void DoRun()
override;
203 :
TestCase(
"A typical real-world example")
224 "address should equal initialized address for given prefix");
228 "address should equal next address for given prefix");
232 "address should equal next address for given prefix");
248 "address should equal initialized address for given prefix");
262 void DoRun()
override;
267 :
TestCase(
"Make sure that the address collision logic works.")
IPv6 address allocator Test.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
void DoRun() override
Implementation to actually run this TestCase.
AddressAllocator6TestCase()
IPv6 address collision Test.
void DoRun() override
Implementation to actually run this TestCase.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
AddressCollision6TestCase()
IPv6 example of an address generator Test.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
ExampleAddress6GeneratorTestCase()
void DoRun() override
Implementation to actually run this TestCase.
IPv6 address generator TestSuite.
Ipv6AddressGeneratorTestSuite()
IPv6 network number and address allocator Test.
void DoRun() override
Implementation to actually run this TestCase.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
NetworkAndAddress6TestCase()
IPv6 network number allocator Test.
NetworkNumber6AllocatorTestCase()
void DoRun() override
Implementation to actually run this TestCase.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
static void Init(const Ipv6Address net, const Ipv6Prefix prefix, const Ipv6Address interfaceId="::1")
Initialise the base network and interfaceId for the generator.
static void TestMode()
Used to turn off fatal errors and assertions, for testing.
static Ipv6Address NextAddress(const Ipv6Prefix prefix)
Allocate the next Ipv6Address for the configured network and prefix.
static Ipv6Address GetNetwork(const Ipv6Prefix prefix)
Get the current network of the given Ipv6Prefix.
static void InitAddress(const Ipv6Address interfaceId, const Ipv6Prefix prefix)
Set the interfaceId for the given Ipv6Prefix.
static bool AddAllocated(const Ipv6Address addr)
Add the Ipv6Address to the list of IPv6 entries.
static Ipv6Address GetAddress(const Ipv6Prefix prefix)
Get the Ipv6Address that will be allocated upon NextAddress ()
static Ipv6Address NextNetwork(const Ipv6Prefix prefix)
Get the next network according to the given Ipv6Prefix.
static bool IsAddressAllocated(const Ipv6Address addr)
Check the Ipv6Address allocation in the list of IPv6 entries.
static void Reset()
Reset the networks and Ipv6Address to zero.
Describes an IPv6 address.
Describes an IPv6 prefix.
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 Ipv6AddressGeneratorTestSuite g_ipv6AddressGeneratorTestSuite
Static variable for test initialization.
Every class exported by the ns3 library is enclosed in the ns3 namespace.