19 #include "ns3/ipv6-address-helper.h"
20 #include "ns3/ipv6-address-generator.h"
21 #include "ns3/ipv4-address-helper.h"
22 #include "ns3/simple-net-device.h"
23 #include "ns3/net-device-container.h"
24 #include "ns3/node-container.h"
25 #include "ns3/internet-stack-helper.h"
38 virtual void DoRun (
void);
39 virtual void DoTeardown (
void);
42 IpAddressHelperTestCasev6::IpAddressHelperTestCasev6 ()
43 :
TestCase (
"IpAddressHelper Ipv6 test case")
47 IpAddressHelperTestCasev6::~IpAddressHelperTestCasev6 ()
58 NS_TEST_ASSERT_MSG_EQ (ipAddr1,
Ipv6Address (
"2001:db8::1"),
"Ipv6AddressHelper failure");
60 NS_TEST_ASSERT_MSG_EQ (ipAddr1,
Ipv6Address (
"2001:db8::2"),
"Ipv6AddressHelper failure");
63 NS_TEST_ASSERT_MSG_EQ (ipAddr1,
Ipv6Address (
"2001:db8:0:1:0:0:0:1"),
"Ipv6AddressHelper failure");
68 NS_TEST_ASSERT_MSG_EQ (ipAddr1,
Ipv6Address (
"2001:db81::1"),
"Ipv6AddressHelper failure");
72 NS_TEST_ASSERT_MSG_EQ (ipAddr1,
Ipv6Address (
"2001:db81::15"),
"Ipv6AddressHelper failure");
74 NS_TEST_ASSERT_MSG_EQ (ipAddr1,
Ipv6Address (
"2001:db81::16"),
"Ipv6AddressHelper failure");
78 NS_TEST_ASSERT_MSG_EQ (ipAddr1,
Ipv6Address (
"2001:db81:0:1::15"),
"Ipv6AddressHelper failure");
87 NS_TEST_ASSERT_MSG_EQ (ipAddr1,
Ipv6Address (
"2001:dddd:0:2::1"),
"Ipv6AddressHelper failure");
92 NS_TEST_ASSERT_MSG_EQ (ipAddr1,
Ipv6Address (
"2001:db82::1"),
"Ipv6AddressHelper failure");
124 NS_TEST_ASSERT_MSG_EQ (d1addr.
GetAddress (),
Ipv6Address (
"2001:00aa:0000:0000:0200:00ff:fe00:0001"),
"Ipv6AddressHelper failure");
126 NS_TEST_ASSERT_MSG_EQ (ic.
GetAddress (0,1),
Ipv6Address (
"2001:00aa:0000:0000:0200:00ff:fe00:0001"),
"Ipv6AddressHelper failure");
129 NS_TEST_ASSERT_MSG_EQ (d2addr.GetAddress (),
Ipv6Address (
"2001:00aa:0000:0000:0200:00ff:fe00:0002"),
"Ipv6AddressHelper failure");
131 NS_TEST_ASSERT_MSG_EQ (ic.
GetAddress (1,1),
Ipv6Address (
"2001:00aa:0000:0000:0200:00ff:fe00:0002"),
"Ipv6AddressHelper failure");
137 Ipv6AddressGenerator::Reset ();
138 Simulator::Destroy ();
148 Ipv6AddressHelperTestSuite::Ipv6AddressHelperTestSuite ()
149 :
TestSuite (
"ipv6-address-helper", UNIT)
smart pointer class similar to boost::intrusive_ptr
virtual void DoRun(void)
Implementation to actually run this test case.
Keep track of a set of IPv6 interfaces.
Access to the IPv6 forwarding table, interfaces, and configuration.
IPv6 address associated with an interface.
aggregate IP/TCP/UDP functionality to existing Nodes.
void SetBase(Ipv6Address network, Ipv6Prefix prefix, Ipv6Address base=Ipv6Address("::1"))
Set the base network number, network prefix, and base interface ID.
Ipv6InterfaceContainer Assign(const NetDeviceContainer &c)
Allocate an Ipv6InterfaceContainer with auto-assigned addresses.
Ipv6Address GetAddress() const
Get the IPv6 address.
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
void SetIpv4StackInstall(bool enable)
Enable/disable IPv4 stack install.
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
void Install(std::string nodeName) const
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual test case to this test suite.
Helper class to auto-assign global IPv6 unicast addresses.
Describes an IPv6 address.
uint32_t AddDevice(Ptr< NetDevice > device)
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
virtual void SetAddress(Address address)
Ipv6Address NewAddress(Address addr)
Allocate a new Ipv6Address.
Describes an IPv6 prefix. It is just a bitmask like Ipv4Mask.
void NewNetwork(Ipv6Address network, Ipv6Prefix prefix) NS_DEPRECATED
Allocate a new network.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< T > GetObject(void) const
virtual void DoTeardown(void)
Implementation to do any local setup required for this test case.
Ipv6Address GetAddress(uint32_t i, uint32_t j) const
Get the address for the specified index.