Keep track of a set of IPv6 interfaces. More...
#include <ipv6-interface-container.h>
Public Types | |
typedef std::vector< std::pair < Ptr< Ipv6 >, uint32_t > >::const_iterator | Iterator |
Public Member Functions | |
Ipv6InterfaceContainer () | |
Constructor. | |
uint32_t | GetN (void) const |
uint32_t | GetInterfaceIndex (uint32_t i) const |
Get the interface index for the specified node index. | |
Ipv6Address | GetAddress (uint32_t i, uint32_t j) const |
Get the address for the specified index. | |
void | Add (Ptr< Ipv6 > ipv6, uint32_t interface) |
Add a couple IPv6/interface. | |
Iterator | Begin (void) const |
Get an iterator which refers to the first pair in the container. | |
Iterator | End (void) const |
Get an iterator which indicates past-the-last Node in the container. | |
void | Add (Ipv6InterfaceContainer &c) |
Fusion with another Ipv6InterfaceContainer. | |
void | Add (std::string ipv6Name, uint32_t interface) |
Add a couple of name/interface. | |
void | SetRouter (uint32_t i, bool router) |
Set the state of the stack (act as a router or not) for the specified index. | |
void | SetDefaultRoute (uint32_t i, uint32_t router) |
Set the default route for the specified index. |
Keep track of a set of IPv6 interfaces.
Add a couple IPv6/interface.
ipv6 | IPv6 address | |
interface | interface index |
void ns3::Ipv6InterfaceContainer::Add | ( | std::string | ipv6Name, | |
uint32_t | interface | |||
) |
Add a couple of name/interface.
ipv6Name | name of a node | |
interface | interface index to add |
void ns3::Ipv6InterfaceContainer::Add | ( | Ipv6InterfaceContainer & | c | ) |
Fusion with another Ipv6InterfaceContainer.
c | container |
Iterator ns3::Ipv6InterfaceContainer::Begin | ( | void | ) | const |
Get an iterator which refers to the first pair in the container.
Pairs can be retrieved from the container in two ways. First, directly by an index into the container, and second, using an iterator. This method is used in the iterator method and is typically used in a for-loop to run through the pairs
Ipv4InterfaceContainer::Iterator i; for (i = container.Begin (); i != container.End (); ++i) { std::pair<Ptr<Ipv6>, uint32_t> pair = *i; method (pair.first, pair.second); // use the pair }
Iterator ns3::Ipv6InterfaceContainer::End | ( | void | ) | const |
Get an iterator which indicates past-the-last Node in the container.
Nodes can be retrieved from the container in two ways. First, directly by an index into the container, and second, using an iterator. This method is used in the iterator method and is typically used in a for-loop to run through the Nodes
NodeContainer::Iterator i; for (i = container.Begin (); i != container.End (); ++i) { std::pair<Ptr<Ipv6>, uint32_t> pair = *i; method (pair.first, pair.second); // use the pair }
Ipv6Address ns3::Ipv6InterfaceContainer::GetAddress | ( | uint32_t | i, | |
uint32_t | j | |||
) | const |
Get the address for the specified index.
i | interface index | |
j | address index, generally index 0 is the link-local address |
uint32_t ns3::Ipv6InterfaceContainer::GetInterfaceIndex | ( | uint32_t | i | ) | const |
Get the interface index for the specified node index.
i | index of the node |
uint32_t ns3::Ipv6InterfaceContainer::GetN | ( | void | ) | const |
Pairs can be retrieved from the container in two ways. First, directly by an index into the container, and second, using an iterator. This method is used in the direct method and is typically used to define an ending condition in a for-loop that runs through the stored Nodes
uint32_t nNodes = container.GetN (); for (uint32_t i = 0 i < nNodes; ++i) { std::pair<Ptr<Ipv6>, uint32_t> pair = container.Get (i); method (pair.first, pair.second); // use the pair }
void ns3::Ipv6InterfaceContainer::SetDefaultRoute | ( | uint32_t | i, | |
uint32_t | router | |||
) |
Set the default route for the specified index.
i | index | |
router | the default router |
void ns3::Ipv6InterfaceContainer::SetRouter | ( | uint32_t | i, | |
bool | router | |||
) |
Set the state of the stack (act as a router or not) for the specified index.
i | index | |
router | true : is a router, false : is an host |