21 #include "ns3/ipv6-address-generator.h"
22 #include "ns3/simulation-singleton.h"
36 virtual void DoRun (
void);
37 virtual void DoTeardown (
void);
41 :
TestCase (
"Make sure the network number allocator is working on some of network prefixes.")
56 network = Ipv6AddressGenerator::GetNetwork (
Ipv6Prefix (
"FFFF::0"));
58 network = Ipv6AddressGenerator::NextNetwork (
Ipv6Prefix (
"FFFF::0"));
61 Ipv6AddressGenerator::Init (
Ipv6Address (
"0:1::0:0"),
63 network = Ipv6AddressGenerator::GetNetwork (
Ipv6Prefix (
"FFFF:FFFF::0"));
65 network = Ipv6AddressGenerator::NextNetwork (
Ipv6Prefix (
"FFFF:FFFF::0"));
68 Ipv6AddressGenerator::Init (
Ipv6Address (
"0:0:1::0"),
70 network = Ipv6AddressGenerator::GetNetwork (
Ipv6Prefix (
"FFFF:FFFF:FFFF::0"));
72 network = Ipv6AddressGenerator::NextNetwork (
Ipv6Prefix (
"FFFF:FFFF:FFFF::0"));
88 virtual void DoRun (
void);
93 :
TestCase (
"Sanity check on allocation of addresses")
105 Ipv6AddressGenerator::NextNetwork (
Ipv6Prefix (64));
128 Simulator::Destroy ();
142 virtual void DoRun (
void);
147 :
TestCase (
"Make sure Network and address allocation play together.")
155 Simulator::Destroy ();
171 network = Ipv6AddressGenerator::NextNetwork (
Ipv6Prefix (
"FFFF::"));
189 virtual void DoRun (
void);
194 :
TestCase (
"A typical real-world example")
209 Ipv6AddressGenerator::Init (
Ipv6Address (
"2001:0AB8::"),
221 Ipv6AddressGenerator::NextNetwork (
Ipv6Prefix (
"FFFF:FFFF:FFFF::0"));
225 Ipv6AddressGenerator::InitAddress (
Ipv6Address (
"::3"),
250 :
TestCase (
"Make sure that the address collision logic works.")
258 Simulator::Destroy ();
263 Ipv6AddressGenerator::AddAllocated (
"0::0:5");
264 Ipv6AddressGenerator::AddAllocated (
"0::0:10");
265 Ipv6AddressGenerator::AddAllocated (
"0::0:15");
266 Ipv6AddressGenerator::AddAllocated (
"0::0:20");
268 Ipv6AddressGenerator::AddAllocated (
"0::0:4");
269 Ipv6AddressGenerator::AddAllocated (
"0::0:3");
270 Ipv6AddressGenerator::AddAllocated (
"0::0:2");
271 Ipv6AddressGenerator::AddAllocated (
"0::0:1");
273 Ipv6AddressGenerator::AddAllocated (
"0::0:6");
274 Ipv6AddressGenerator::AddAllocated (
"0::0:7");
275 Ipv6AddressGenerator::AddAllocated (
"0::0:8");
276 Ipv6AddressGenerator::AddAllocated (
"0::0:9");
278 Ipv6AddressGenerator::AddAllocated (
"0::0:11");
279 Ipv6AddressGenerator::AddAllocated (
"0::0:12");
280 Ipv6AddressGenerator::AddAllocated (
"0::0:13");
281 Ipv6AddressGenerator::AddAllocated (
"0::0:14");
283 Ipv6AddressGenerator::AddAllocated (
"0::0:19");
284 Ipv6AddressGenerator::AddAllocated (
"0::0:18");
285 Ipv6AddressGenerator::AddAllocated (
"0::0:17");
286 Ipv6AddressGenerator::AddAllocated (
"0::0:16");
288 Ipv6AddressGenerator::TestMode ();
289 bool added = Ipv6AddressGenerator::AddAllocated (
"0::0:21");
292 added = Ipv6AddressGenerator::AddAllocated (
"0::0:4");
295 added = Ipv6AddressGenerator::AddAllocated (
"0::0:9");
298 added = Ipv6AddressGenerator::AddAllocated (
"0::0:16");
301 added = Ipv6AddressGenerator::AddAllocated (
"0::0:21");
IPv6 address allocator Test.
AddressAllocator6TestCase()
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual void DoTeardown(void)
Implementation to do any local setup required for this TestCase.
IPv6 address collision Test.
AddressCollision6TestCase()
void DoRun(void)
Implementation to actually run this TestCase.
void DoTeardown(void)
Implementation to do any local setup required for this TestCase.
IPv6 example of an address generator Test.
virtual void DoRun(void)
Implementation to actually run this TestCase.
ExampleAddress6GeneratorTestCase()
virtual void DoTeardown(void)
Implementation to do any local setup required for this TestCase.
IPv6 address generator TestSuite.
Ipv6AddressGeneratorTestSuite()
IPv6 network number and address allocator Test.
NetworkAndAddress6TestCase()
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual void DoTeardown(void)
Implementation to do any local setup required for this TestCase.
IPv6 network number allocator Test.
NetworkNumber6AllocatorTestCase()
virtual void DoTeardown(void)
Implementation to do any local setup required for this TestCase.
virtual void DoRun(void)
Implementation to actually run this TestCase.
Describes an IPv6 address.
Describes an IPv6 prefix.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
void Reset(void)
Reset the initial value of every attribute as well as the value of every global to what they were bef...
#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.