26 #include "ns3/names.h"
27 #include "ns3/node-list.h"
65 return ipv6->GetAddress(interface, j).GetAddress();
77 Ptr<Ipv6> ipv6 = Names::Find<Ipv6>(ipv6Name);
90 std::pair<Ptr<Ipv6>, uint32_t>
111 "No link-local address found on router, aborting");
124 "Default router setup failed because no Ipv6StaticRouting was found on the node.");
133 uint32_t routerIndex = 0;
135 for (uint32_t index = 0; index <
m_interfaces.size(); index++)
141 if (addr == routerAddress)
153 NS_ASSERT_MSG(found !=
true,
"No such address in the interfaces. Aborting.");
155 for (uint32_t other = 0; other <
m_interfaces.size(); other++)
157 if (other != routerIndex)
166 "Default router setup failed because no Ipv6StaticRouting was found on the node.");
176 "A node shouldn't set itself as the default router, isn't it? Aborting.");
182 "No link-local address found on router, aborting");
190 "Default router setup failed because no Ipv6StaticRouting was found on the node.");
197 uint32_t routerIndex = 0;
199 for (uint32_t index = 0; index <
m_interfaces.size(); index++)
205 if (addr == routerAddr)
217 NS_ASSERT_MSG(found !=
true,
"No such address in the interfaces. Aborting.");
220 "A node shouldn't set itself as the default router, isn't it? Aborting.");
230 "Default router setup failed because no Ipv6StaticRouting was found on the node.");
258 uint32_t nodeIndex = 0;
260 for (uint32_t index = 0; index <
m_interfaces.size(); index++)
278 NS_ASSERT_MSG(found !=
true,
"No such address in the interfaces. Aborting.");
Describes an IPv6 address.
static Ipv6Address GetAny()
Get the "any" (::) Ipv6Address.
IPv6 address associated with an interface.
Ipv6Address GetAddress() const
Get the IPv6 address.
Ipv6InterfaceAddress::Scope_e GetScope() const
Get address scope.
@ LINKLOCAL
Link-local address (fe80::/64)
Keep track of a set of IPv6 interfaces.
void SetForwarding(uint32_t i, bool state)
Set the state of the stack (act as a router or as an host) for the specified index.
uint32_t GetInterfaceIndex(uint32_t i) const
Get the interface index for the specified node index.
Ipv6InterfaceContainer()
Constructor.
void SetDefaultRouteInAllNodes(uint32_t router)
Set the default route for all the devices (except the router itself).
void SetDefaultRoute(uint32_t i, uint32_t router)
Set the default route for the specified index.
InterfaceVector m_interfaces
List of IPv6 stack and interfaces index.
Ipv6Address GetAddress(uint32_t i, uint32_t j) const
Get the address for the specified index.
Ipv6Address GetLinkLocalAddress(uint32_t i)
Get the link-local address for the specified index.
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
std::vector< std::pair< Ptr< Ipv6 >, uint32_t > >::const_iterator Iterator
Container Const Iterator for pairs of Ipv6 smart pointer / Interface Index.
void Add(Ptr< Ipv6 > ipv6, uint32_t interface)
Add a couple IPv6/interface.
std::pair< Ptr< Ipv6 >, uint32_t > Get(uint32_t i) const
Get the std::pair of an Ptr<Ipv6> and interface stored at the location specified by the index.
Iterator Begin() const
Get an iterator which refers to the first pair in the container.
Helper class that adds ns3::Ipv6StaticRouting objects.
Ptr< Ipv6StaticRouting > GetStaticRouting(Ptr< Ipv6 > ipv6) const
Get Ipv6StaticRouting pointer from IPv6 stack.
Smart pointer class similar to boost::intrusive_ptr.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Every class exported by the ns3 library is enclosed in the ns3 namespace.