00001 #ifndef IPV4_INTERFACE_CONTAINER_H 00002 #define IPV4_INTERFACE_CONTAINER_H 00003 00004 #include <stdint.h> 00005 #include <vector> 00006 #include "ns3/ipv4.h" 00007 #include "ns3/ipv4-address.h" 00008 00009 namespace ns3 { 00010 00011 /** 00012 * \brief keep track of a set of ipv4 interfaces. 00013 * 00014 */ 00015 class Ipv4InterfaceContainer 00016 { 00017 public: 00018 /** 00019 * Create an empty Ipv4InterfaceContainer. 00020 */ 00021 Ipv4InterfaceContainer (); 00022 00023 /** 00024 * Concatenate the entries in the other container with ours. 00025 */ 00026 void Add (Ipv4InterfaceContainer other); 00027 00028 /** 00029 * \returns the number of interfaces stored in this Ipv4InterfaceContainer. 00030 */ 00031 uint32_t GetN (void) const; 00032 00033 Ipv4Address GetAddress (uint32_t i) const; 00034 void SetMetric (uint32_t i, uint16_t metric); 00035 00036 void Add (Ptr<Ipv4> ipv4, uint32_t interface); 00037 00038 private: 00039 00040 typedef std::vector<std::pair<Ptr<Ipv4>,uint32_t> > InterfaceVector; 00041 InterfaceVector m_interfaces; 00042 }; 00043 00044 } // namespace ns3 00045 00046 #endif /* IPV4_INTERFACE_CONTAINER_H */