diff options
author | Mauro Sardara <msardara@cisco.com> | 2020-02-07 20:00:06 +0100 |
---|---|---|
committer | Mauro Sardara <msardara@cisco.com> | 2020-02-12 18:40:52 +0100 |
commit | 3bce9bfdce707313de4f9cccdc867abd9edf82df (patch) | |
tree | bd7d75a7251888a3fc269fadebd59842c46a14a1 /libtransport/src/hicn/transport/protocols/protocol.h | |
parent | f9243a2bf823086404be1c41c7bcc1b27cfab7de (diff) |
[HICN-508] [HICN-509] [HICN-506] Manifest rework
Change-Id: I992205148910be008d66b5acb7f6f1365770f9e8
Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'libtransport/src/hicn/transport/protocols/protocol.h')
-rw-r--r-- | libtransport/src/hicn/transport/protocols/protocol.h | 24 |
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 |