face: implement NDNLP fragmentation in EthernetFace
Change-Id: I5b9ff271087ca0b2d5ee38be2f77911cfe9283f4
Refs: #1209
diff --git a/daemon/face/ethernet-face.hpp b/daemon/face/ethernet-face.hpp
index 1dd6593..87e2238 100644
--- a/daemon/face/ethernet-face.hpp
+++ b/daemon/face/ethernet-face.hpp
@@ -28,8 +28,12 @@
#include "common.hpp"
#include "face.hpp"
+#include "ndnlp-partial-message-store.hpp"
+#include "ndnlp-slicer.hpp"
#include "core/network-interface.hpp"
+#include <unordered_map>
+
#ifndef HAVE_LIBPCAP
#error "Cannot include this file when libpcap is not available"
#endif
@@ -136,6 +140,12 @@
getInterfaceMtu() const;
private:
+ struct Reassembler
+ {
+ unique_ptr<ndnlp::PartialMessageStore> pms;
+ EventId expireEvent;
+ };
+
unique_ptr<pcap_t, void(*)(pcap_t*)> m_pcap;
shared_ptr<boost::asio::posix::stream_descriptor> m_socket;
@@ -145,7 +155,11 @@
std::string m_interfaceName;
ethernet::Address m_srcAddress;
ethernet::Address m_destAddress;
+
size_t m_interfaceMtu;
+ unique_ptr<ndnlp::Slicer> m_slicer;
+ std::unordered_map<ethernet::Address, Reassembler> m_reassemblers;
+ static const time::nanoseconds REASSEMBLER_LIFETIME;
};
} // namespace nfd