src/internet-node/ipv4-l3-protocol.cc
changeset 1434 2b63aafb050b
parent 1432 3aef7d7a71c2
child 1435 a70de165a25a
--- a/src/internet-node/ipv4-l3-protocol.cc	Mon Aug 13 14:58:06 2007 -0700
+++ b/src/internet-node/ipv4-l3-protocol.cc	Mon Aug 13 16:21:39 2007 -0700
@@ -691,6 +691,28 @@
   return interface->GetAddress ();
 }
 
+bool
+Ipv4L3Protocol::GetIfIndexForDestination (
+  Ipv4Address destination, uint32_t& ifIndex) const
+{
+  NS_DEBUG("Ipv4L3Protocol::GetIfIndexForDestination (" << destination << 
+    ", " << &ifIndex << ")");
+
+  for (Ipv4RoutingProtocolList::const_iterator i = m_routingProtocols.begin ();
+       i != m_routingProtocols.end (); 
+       i++)
+    {
+      NS_DEBUG("Ipv4L3Protocol::Lookup (): Requesting Source Address");
+      uint32_t ifIndex;
+
+      if ((*i).second->RequestIfIndex (destination, ifIndex))
+        {
+          return true;
+        }
+    }
+  return false;
+}
+
 uint16_t 
 Ipv4L3Protocol::GetMtu (uint32_t i) const
 {