00001 #include "v4ping-helper.h" 00002 #include "ns3/v4ping.h" 00003 00004 namespace ns3 { 00005 00006 V4PingHelper::V4PingHelper (Ipv4Address remote) 00007 { 00008 m_factory.SetTypeId ("ns3::V4Ping"); 00009 m_factory.Set ("Remote", Ipv4AddressValue (remote)); 00010 } 00011 00012 void 00013 V4PingHelper::SetAttribute (std::string name, const AttributeValue &value) 00014 { 00015 m_factory.Set (name, value); 00016 } 00017 00018 ApplicationContainer 00019 V4PingHelper::Install (Ptr<Node> node) const 00020 { 00021 return ApplicationContainer (InstallPriv (node)); 00022 } 00023 00024 ApplicationContainer 00025 V4PingHelper::Install (NodeContainer c) const 00026 { 00027 ApplicationContainer apps; 00028 for (NodeContainer::Iterator i = c.Begin (); i != c.End (); ++i) 00029 { 00030 apps.Add (InstallPriv (*i)); 00031 } 00032 00033 return apps; 00034 } 00035 00036 Ptr<Application> 00037 V4PingHelper::InstallPriv (Ptr<Node> node) const 00038 { 00039 Ptr<V4Ping> app = m_factory.Create<V4Ping> (); 00040 node->AddApplication (app); 00041 00042 return app; 00043 } 00044 00045 } // namespace ns3