--- a/src/internet-stack/wscript Wed Jul 02 21:07:36 2008 -0700
+++ b/src/internet-stack/wscript Thu Jul 03 09:44:23 2008 -0400
@@ -39,4 +39,7 @@
'udp-header.h',
'tcp-header.h',
'sequence-number.h',
+ 'ipv4-interface.h',
+ 'ipv4-l3-protocol.h',
+ 'ipv4-static-routing.h',
]
--- a/src/node/ipv4.h Wed Jul 02 21:07:36 2008 -0700
+++ b/src/node/ipv4.h Thu Jul 03 09:44:23 2008 -0400
@@ -425,6 +425,11 @@
/**
* \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 @@
* \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;
--- a/src/node/node.cc Wed Jul 02 21:07:36 2008 -0700
+++ b/src/node/node.cc Thu Jul 03 09:44:23 2008 -0400
@@ -128,6 +128,18 @@
{
return m_applications.size ();
}
+Ptr<Application>
+Node::GetFirstApplication(TypeId tid)
+{
+ for (std::vector<Ptr<Application> >::iterator i = m_applications.begin ();
+ i != m_applications.end (); i++) {
+ Ptr<Application> app = *i;
+ if (app->GetInstanceTypeId() == tid)
+ return app;
+ }
+
+ return 0;
+}
void
Node::DoDispose()
--- a/src/node/node.h Wed Jul 02 21:07:36 2008 -0700
+++ b/src/node/node.h Thu Jul 03 09:44:23 2008 -0400
@@ -123,6 +123,13 @@
*/
Ptr<Application> GetApplication (uint32_t index) const;
/**
+ * \param index
+ * \returns the application associated to this requested index
+ * within this Node.
+ */
+ Ptr<Application> GetFirstApplication (TypeId tid);
+
+ /**
* \returns the number of applications associated to this Node.
*/
uint32_t GetNApplications (void) const;