From af9bc5595a4c6b6eaeb4ebbbc38dbdbafe9313d2 Mon Sep 17 00:00:00 2001 From: Pavel Boyko Date: Thu, 8 Oct 2009 15:47:59 +0400 Subject: [PATCH] [aodv] Fix aodv.cc example & helpers --- examples/{ => routing}/aodv.cc | 0 examples/routing/wscript | 4 ++++ src/helper/aodv-helper.cc | 6 ++++++ src/helper/aodv-helper.h | 14 +++++++++++--- src/helper/v4ping-helper.cc | 6 ++++++ src/helper/v4ping-helper.h | 6 ++++++ 6 files changed, 33 insertions(+), 3 deletions(-) rename examples/{ => routing}/aodv.cc (100%) diff --git a/examples/aodv.cc b/examples/routing/aodv.cc similarity index 100% rename from examples/aodv.cc rename to examples/routing/aodv.cc diff --git a/examples/routing/wscript b/examples/routing/wscript index bff2f8b0e..c3404d2c7 100644 --- a/examples/routing/wscript +++ b/examples/routing/wscript @@ -44,3 +44,7 @@ def build(bld): obj = bld.create_ns3_program('simple-routing-ping6', ['csma', 'internet-stack']) obj.source = 'simple-routing-ping6.cc' + + obj = bld.create_ns3_program('aodv', + ['wifi', 'internet-stack', 'aodv']) + obj.source = 'aodv.cc' diff --git a/src/helper/aodv-helper.cc b/src/helper/aodv-helper.cc index 9f5d54fa1..42180a207 100644 --- a/src/helper/aodv-helper.cc +++ b/src/helper/aodv-helper.cc @@ -31,6 +31,12 @@ AodvHelper::AodvHelper() : Ipv4RoutingHelper () m_agentFactory.SetTypeId ("ns3::aodv::RoutingProtocol"); } +AodvHelper* +AodvHelper::Copy (void) const +{ + return new AodvHelper (*this); +} + Ptr AodvHelper::Create (Ptr node) const { diff --git a/src/helper/aodv-helper.h b/src/helper/aodv-helper.h index b58cfe5cd..c0b7d347b 100644 --- a/src/helper/aodv-helper.h +++ b/src/helper/aodv-helper.h @@ -35,17 +35,25 @@ class AodvHelper : public Ipv4RoutingHelper { public: AodvHelper(); - + + /** + * \internal + * \returns pointer to clone of this OlsrHelper + * + * This method is mainly for internal use by the other helpers; + * clients are expected to free the dynamic memory allocated by this method + */ + AodvHelper* Copy (void) const; + /** * \param node the node on which the routing protocol will run - * \return a newly-created routing protocol + * \returns a newly-created routing protocol * * This method will be called by ns3::InternetStackHelper::Install * * TODO: support installing AODV on the subset of all available IP interfaces */ virtual Ptr Create (Ptr node) const; - /** * \param name the name of the attribute to set * \param value the value of the attribute to set. diff --git a/src/helper/v4ping-helper.cc b/src/helper/v4ping-helper.cc index 0e2467205..e8767db76 100644 --- a/src/helper/v4ping-helper.cc +++ b/src/helper/v4ping-helper.cc @@ -30,6 +30,12 @@ V4PingHelper::V4PingHelper (Ipv4Address remote) m_factory.Set ("Remote", Ipv4AddressValue (remote)); } +void +V4PingHelper::SetAttribute (std::string name, const AttributeValue &value) +{ + m_factory.Set (name, value); +} + ApplicationContainer V4PingHelper::Install (Ptr node) const { diff --git a/src/helper/v4ping-helper.h b/src/helper/v4ping-helper.h index 1e2f5617e..a26029c78 100644 --- a/src/helper/v4ping-helper.h +++ b/src/helper/v4ping-helper.h @@ -55,6 +55,12 @@ public: */ ApplicationContainer Install (std::string nodeName) const; + /** + * \brief Configure ping applications attribute + * \param name attribute's name + * \param value attribute's value + */ + void SetAttribute (std::string name, const AttributeValue &value); private: /** * \internal