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")
 
  103   address = Ipv6AddressGenerator::GetNetwork (
Ipv6Prefix (64));
 
  105   Ipv6AddressGenerator::NextNetwork (
Ipv6Prefix (64));
 
  106   address = Ipv6AddressGenerator::GetNetwork (
Ipv6Prefix (64));
 
  108   address = Ipv6AddressGenerator::GetAddress (
Ipv6Prefix (64));
 
  110   address = Ipv6AddressGenerator::NextAddress (
Ipv6Prefix (64));
 
  112   address = Ipv6AddressGenerator::NextAddress (
Ipv6Prefix (64));
 
  117   address = Ipv6AddressGenerator::NextAddress (
Ipv6Prefix (16));
 
  119   address = Ipv6AddressGenerator::NextAddress (
Ipv6Prefix (16));
 
  128   Simulator::Destroy ();
 
  142   virtual void DoRun (
void);
 
  147   : 
TestCase (
"Make sure Network and address allocation play together.")
 
  155   Simulator::Destroy ();
 
  166   address = Ipv6AddressGenerator::NextAddress (
Ipv6Prefix (16));
 
  168   address = Ipv6AddressGenerator::NextAddress (
Ipv6Prefix (16));
 
  171   network = Ipv6AddressGenerator::NextNetwork (
Ipv6Prefix (
"FFFF::"));
 
  173   address = Ipv6AddressGenerator::NextAddress (
Ipv6Prefix (16));
 
  189   virtual void DoRun (
void);
 
  194   : 
TestCase (
"A typical real-world example")
 
  209   Ipv6AddressGenerator::Init (
Ipv6Address (
"2001:0AB8::"),
 
  211   address = Ipv6AddressGenerator::NextAddress (
Ipv6Prefix (48));
 
  213   address = Ipv6AddressGenerator::NextAddress (
Ipv6Prefix (48));
 
  215   address = Ipv6AddressGenerator::NextAddress (
Ipv6Prefix (48));
 
  221   Ipv6AddressGenerator::NextNetwork (
Ipv6Prefix (
"FFFF:FFFF:FFFF::0"));
 
  225   Ipv6AddressGenerator::InitAddress (
Ipv6Address (
"::3"),
 
  230   address = Ipv6AddressGenerator::NextAddress (
Ipv6Prefix (48));
 
  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");
 
virtual void DoRun(void)
Implementation to actually run this TestCase. 
 
IPv6 address allocator Test. 
 
IPv6 network number allocator Test. 
 
AddressAllocator6TestCase()
 
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not. 
 
virtual void DoRun(void)
Implementation to actually run this TestCase. 
 
Ipv6AddressGeneratorTestSuite()
 
virtual void DoTeardown(void)
Implementation to do any local setup required for this TestCase. 
 
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite. 
 
NetworkAndAddress6TestCase()
 
virtual void DoTeardown(void)
Implementation to do any local setup required for this TestCase. 
 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
 
NetworkNumber6AllocatorTestCase()
 
void Reset(void)
Reset the initial value of every attribute as well as the value of every global to what they were bef...
 
virtual void DoTeardown(void)
Implementation to do any local setup required for this TestCase. 
 
ExampleAddress6GeneratorTestCase()
 
IPv6 example of an address generator Test. 
 
Describes an IPv6 address. 
 
virtual void DoRun(void)
Implementation to actually run this TestCase. 
 
virtual void DoRun(void)
Implementation to actually run this TestCase. 
 
void DoTeardown(void)
Implementation to do any local setup required for this TestCase. 
 
Describes an IPv6 prefix. 
 
void DoRun(void)
Implementation to actually run this TestCase. 
 
IPv6 network number and address allocator Test. 
 
virtual void DoTeardown(void)
Implementation to do any local setup required for this TestCase. 
 
IPv6 address collision Test. 
 
static Ipv6AddressGeneratorTestSuite g_ipv6AddressGeneratorTestSuite
Static variable for test initialization. 
 
AddressCollision6TestCase()
 
IPv6 address generator TestSuite.