model: First set of major API changes and reorganizations
Main motive: change interface in Face class, resulting in need to change forwarding strategy interfaces
Refs #1005 (http://redmine.named-data.net/)
diff --git a/model/ndn-net-device-face.cc b/model/ndn-net-device-face.cc
index 67dc659..03a9cca 100644
--- a/model/ndn-net-device-face.cc
+++ b/model/ndn-net-device-face.cc
@@ -82,19 +82,31 @@
}
void
-NetDeviceFace::RegisterProtocolHandler (ProtocolHandler handler)
+NetDeviceFace::RegisterProtocolHandlers (const InterestHandler &interestHandler, const DataHandler &dataHandler)
{
NS_LOG_FUNCTION (this);
- Face::RegisterProtocolHandler (handler);
+ Face::RegisterProtocolHandlers (interestHandler, dataHandler);
m_node->RegisterProtocolHandler (MakeCallback (&NetDeviceFace::ReceiveFromNetDevice, this),
L3Protocol::ETHERNET_FRAME_TYPE, m_netDevice, true/*promiscuous mode*/);
}
-bool
-NetDeviceFace::SendImpl (Ptr<Packet> packet)
+void
+NetDeviceFace:: UnRegisterProtocolHandlers ()
{
+ m_node->UnRegisterProtocolHandler (MakeCallback (&NetDeviceFace::ReceiveFromNetDevice, this));
+ Face::UnRegisterProtocolHandlers ();
+}
+
+bool
+NetDeviceFace::Send (Ptr<Packet> packet)
+{
+ if (!Face::Send ())
+ {
+ return false;
+ }
+
NS_LOG_FUNCTION (this << packet);
NS_ASSERT_MSG (packet->GetSize () <= m_netDevice->GetMtu (),