From ed9944dc14740758f2ea213fb4a037dcd18ca486 Mon Sep 17 00:00:00 2001 From: "tjkopena@cs.drexel.edu" Date: Thu, 3 Jul 2008 09:44:23 -0400 Subject: [PATCH] Minor doc notes added to ipv4.h --- src/internet-stack/wscript | 3 +++ src/node/ipv4.h | 10 ++++++++++ src/node/node.cc | 12 ++++++++++++ src/node/node.h | 7 +++++++ 4 files changed, 32 insertions(+) diff --git a/src/internet-stack/wscript b/src/internet-stack/wscript index 780a84a98..6f1b7bbd7 100644 --- a/src/internet-stack/wscript +++ b/src/internet-stack/wscript @@ -39,4 +39,7 @@ def build(bld): 'udp-header.h', 'tcp-header.h', 'sequence-number.h', + 'ipv4-interface.h', + 'ipv4-l3-protocol.h', + 'ipv4-static-routing.h', ] diff --git a/src/node/ipv4.h b/src/node/ipv4.h index d2157c959..f6ccec45e 100644 --- a/src/node/ipv4.h +++ b/src/node/ipv4.h @@ -425,6 +425,11 @@ public: /** * \param i index of ipv4 interface * \returns the address associated to the underlying ipv4 interface + * + * Note that the broadcast address for this interface may be fetched + * from the Ipv4Address object returned here using + * Ipv4Address::GetSubnetDirectedBroadcast(mask), where the mask for + * the interface may be retrived using Ipv4::GetNetworkMask(i). */ virtual Ipv4Address GetAddress (uint32_t i) const = 0; @@ -432,6 +437,11 @@ public: * \param destination The IP address of a hypothetical destination. * \returns The IP address assigned to the interface that will be used * if we were to send a packet to destination. + * + * Note that the broadcast address for this interface may be fetched + * from the Ipv4Address object returned here using + * Ipv4Address::GetSubnetDirectedBroadcast(mask), where the mask for + * the interface may be retrived using Ipv4::GetNetworkMask(i). */ virtual Ipv4Address GetSourceAddress (Ipv4Address destination) const = 0; diff --git a/src/node/node.cc b/src/node/node.cc index ef56ec6db..42813b294 100644 --- a/src/node/node.cc +++ b/src/node/node.cc @@ -128,6 +128,18 @@ Node::GetNApplications (void) const { return m_applications.size (); } +Ptr +Node::GetFirstApplication(TypeId tid) +{ + for (std::vector >::iterator i = m_applications.begin (); + i != m_applications.end (); i++) { + Ptr app = *i; + if (app->GetInstanceTypeId() == tid) + return app; + } + + return 0; +} void Node::DoDispose() diff --git a/src/node/node.h b/src/node/node.h index 8a48d1d62..ecd0bb2d7 100644 --- a/src/node/node.h +++ b/src/node/node.h @@ -122,6 +122,13 @@ public: * within this Node. */ Ptr GetApplication (uint32_t index) const; + /** + * \param index + * \returns the application associated to this requested index + * within this Node. + */ + Ptr GetFirstApplication (TypeId tid); + /** * \returns the number of applications associated to this Node. */