1 #ifndef IPV4_INTERFACE_CONTAINER_H
2 #define IPV4_INTERFACE_CONTAINER_H
7 #include "ns3/ipv4-address.h"
38 typedef std::vector<std::pair<Ptr<Ipv4>, uint32_t> >::const_iterator
Iterator;
116 uint32_t
GetN (
void)
const;
135 void SetMetric (uint32_t i, uint16_t metric);
156 void Add (std::pair<
Ptr<Ipv4>, uint32_t> ipInterfacePair);
168 void Add (std::string ipv4Name, uint32_t interface);
179 std::pair<Ptr<Ipv4>, uint32_t>
Get (uint32_t i)
const;
smart pointer class similar to boost::intrusive_ptr
std::pair< Ptr< Ipv4 >, uint32_t > Get(uint32_t i) const
Get the std::pair of an Ptr and interface stored at the location specified by the index...
Ipv4InterfaceContainer()
Create an empty Ipv4InterfaceContainer.
holds a vector of std::pair of Ptr and interface index.
uint32_t GetN(void) const
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
std::vector< std::pair< Ptr< Ipv4 >, uint32_t > > InterfaceVector
Container for pairs of Ipv4 smart pointer / Interface Index.
std::vector< std::pair< Ptr< Ipv4 >, uint32_t > >::const_iterator Iterator
Container Const Iterator for pairs of Ipv4 smart pointer / Interface Index.
Ipv4 addresses are stored in host order in this class.
void SetMetric(uint32_t i, uint16_t metric)
Set a metric for the given interface.
Iterator Begin(void) const
Get an iterator which refers to the first pair in the container.
InterfaceVector m_interfaces
List of IPv4 stack and interfaces index.
void Add(Ipv4InterfaceContainer other)
Concatenate the entries in the other container with ours.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const