aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/hicn/transport/protocols/protocol.h
diff options
context:
space:
mode:
Diffstat (limited to 'libtransport/src/hicn/transport/protocols/protocol.h')
-rw-r--r--libtransport/src/hicn/transport/protocols/protocol.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/libtransport/src/hicn/transport/protocols/protocol.h b/libtransport/src/hicn/transport/protocols/protocol.h
index e4821b6a0..87fab588b 100644
--- a/libtransport/src/hicn/transport/protocols/protocol.h
+++ b/libtransport/src/hicn/transport/protocols/protocol.h
@@ -18,7 +18,10 @@
#include <atomic>
#include <hicn/transport/interfaces/socket.h>
+#include <hicn/transport/protocols/data_processing_events.h>
+#include <hicn/transport/protocols/indexer.h>
#include <hicn/transport/protocols/packet_manager.h>
+#include <hicn/transport/protocols/reassembly.h>
#include <hicn/transport/protocols/statistics.h>
#include <hicn/transport/utils/object_pool.h>
@@ -28,6 +31,8 @@ namespace protocol {
using namespace core;
+class IndexVerificationManager;
+
class TransportProtocolCallback {
virtual void onContentObject(const core::Interest &interest,
const core::ContentObject &content_object) = 0;
@@ -35,11 +40,15 @@ class TransportProtocolCallback {
};
class TransportProtocol : public interface::BasePortal::ConsumerCallback,
- public PacketManager<Interest> {
+ public PacketManager<Interest>,
+ public ContentObjectProcessingEventCallback {
static constexpr std::size_t interest_pool_size = 4096;
+ friend class ManifestIndexManager;
+
public:
- TransportProtocol(interface::ConsumerSocket *icn_socket);
+ TransportProtocol(interface::ConsumerSocket *icn_socket,
+ Reassembly *reassembly_protocol);
virtual ~TransportProtocol() = default;
@@ -53,6 +62,12 @@ class TransportProtocol : public interface::BasePortal::ConsumerCallback,
virtual void scheduleNextInterests() = 0;
+ // Events generated by the indexing
+ virtual void onContentReassembled(std::error_code ec);
+ virtual void onPacketDropped(Interest::Ptr &&interest,
+ ContentObject::Ptr &&content_object) = 0;
+ virtual void onReassemblyFailed(std::uint32_t missing_segment) = 0;
+
protected:
// Consumer Callback
virtual void reset() = 0;
@@ -61,13 +76,14 @@ class TransportProtocol : public interface::BasePortal::ConsumerCallback,
protected:
interface::ConsumerSocket *socket_;
+ std::unique_ptr<Reassembly> reassembly_protocol_;
+ std::unique_ptr<IndexManager> index_manager_;
std::shared_ptr<interface::BasePortal> portal_;
std::atomic<bool> is_running_;
// True if it si the first time we schedule an interest
std::atomic<bool> is_first_;
- TransportStatistics stats_;
+ TransportStatistics *stats_;
};
} // end namespace protocol
-
} // end namespace transport