Adapt OLSR to routing API changes

This commit is contained in:
Gustavo J. A. M. Carneiro
2007-09-12 18:28:18 +01:00
parent 3e77a6301d
commit d09deab2f1
3 changed files with 25 additions and 3 deletions

View File

@@ -184,7 +184,6 @@ int main (int argc, char *argv[])
// Start the sink
sink->Start (Seconds (1.1));
sink->Stop (Seconds (10.0));
sink->SetQuiet (); // disable output from the Receive callback
// Here, finish off packet routing configuration
// This will likely set by some global StaticRouting object in the future

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.

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