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/ccnx-l3-protocol.cc b/model/ccnx-l3-protocol.cc
index 4b832a4..d045339 100644
--- a/model/ccnx-l3-protocol.cc
+++ b/model/ccnx-l3-protocol.cc
@@ -38,6 +38,8 @@
#include "ccnx-interest-header.h"
#include "ccnx-content-object-header.h"
+#include "ccnx-net-device-face.h"
+
#include <boost/foreach.hpp>
NS_LOG_COMPONENT_DEFINE ("CcnxL3Protocol");
@@ -184,6 +186,20 @@
return 0;
}
+Ptr<CcnxFace>
+CcnxL3Protocol::GetFaceByNetDevice (Ptr<NetDevice> netDevice) const
+{
+ BOOST_FOREACH (const Ptr<CcnxFace> &face, m_faces) // this function is not supposed to be called often, so linear search is fine
+ {
+ Ptr<CcnxNetDeviceFace> netDeviceFace = DynamicCast<CcnxNetDeviceFace> (face);
+ if (netDeviceFace == 0) continue;
+
+ if (netDeviceFace->GetNetDevice () == netDevice)
+ return face;
+ }
+ return 0;
+}
+
uint32_t
CcnxL3Protocol::GetNFaces (void) const
{