Finishing with FIB initialization based on IPv4 global routing controller
Example ccnx-routing-simple.cc shows all necessary steps to make it work.
diff --git a/model/ipv4-global-routing-ordered-nexthops.cc b/model/ipv4-global-routing-ordered-nexthops.cc
index 9ed2b60..a01c044 100644
--- a/model/ipv4-global-routing-ordered-nexthops.cc
+++ b/model/ipv4-global-routing-ordered-nexthops.cc
@@ -108,8 +108,7 @@
Ptr<Ipv4Route>
Ipv4GlobalRoutingOrderedNexthops::LookupGlobal (Ipv4Address dest, Ptr<NetDevice> oif)
{
- NS_LOG_FUNCTION_NOARGS ();
- NS_LOG_LOGIC ("Looking for route for destination " << dest);
+ NS_LOG_FUNCTION (this << dest << oif);
Ipv4AddressTrieMap::const_iterator longest_prefix_map = m_routes.longest_prefix_match (dest);
if (longest_prefix_map == m_routes.end ())
@@ -134,6 +133,21 @@
return rtentry;
}
+const Ptr<Ipv4GlobalRoutingOrderedNexthops::EntryContainer>
+Ipv4GlobalRoutingOrderedNexthops::Lookup (Ipv4Address dest)
+{
+ NS_LOG_FUNCTION (this << dest);
+
+ Ipv4AddressTrieMap::const_iterator longest_prefix_map = m_routes.longest_prefix_match (dest);
+ if (longest_prefix_map == m_routes.end ())
+ {
+ return 0;
+ }
+
+ return longest_prefix_map->second;
+}
+
+
void
Ipv4GlobalRoutingOrderedNexthops::DeleteRoutes ()
{