Adapt OLSR to routing API changes

This commit is contained in:
Gustavo J. A. M. Carneiro committed 2007-09-12 18:28:18 +01:00
1 parent 5a68ad2e27
commit 79d16187d6
3 files changed
+25 -3

No files matched your search

+20 -1
View File
@@ -106,7 +106,8 @@ RoutingTable::FindSendEntry (RoutingTableEntry const &entry,
bool
RoutingTable::RequestRoute (const Ipv4Header &ipHeader,
RoutingTable::RequestRoute (uint32_t ifIndex,
const Ipv4Header &ipHeader,
Packet packet,
RouteReplyCallback routeReply)
{
@@ -135,6 +136,24 @@ RoutingTable::RequestRoute (const Ipv4Header &ipHeader,
}
}
bool
RoutingTable::RequestIfIndex (Ipv4Address destination,
uint32_t& ifIndex)
{
RoutingTableEntry entry1, entry2;
if (Lookup (destination, entry1))
{
bool foundSendEntry = FindSendEntry (entry1, entry2);
NS_ASSERT (foundSendEntry);
ifIndex = entry2.interface;
return true;
}
else
{
return false;
}
}
///
/// \brief Adds a new entry into the routing table.
+5 -1
View File
@@ -100,9 +100,13 @@ public:
RoutingTableEntry &outEntry) const;
// From Ipv4RoutingProtocol
virtual bool RequestRoute (const Ipv4Header &ipHeader,
virtual bool RequestRoute (uint32_t ifIndex,
const Ipv4Header &ipHeader,
Packet packet,
RouteReplyCallback routeReply);
virtual bool RequestIfIndex (Ipv4Address destination,
uint32_t& ifIndex);
};
}}; // namespace ns3, olsr