diff options
author | Mauro Sardara <msardara@cisco.com> | 2019-02-04 11:06:18 +0100 |
---|---|---|
committer | Alberto Compagno <acompagn+fdio@cisco.com> | 2019-03-05 09:56:19 +0000 |
commit | 6d7704c1b497341fd6dd3c27e3f64d0db062ccc2 (patch) | |
tree | 668c6820653cd84da8474d330d2807a8765f96b5 /libtransport/src/hicn/transport/interfaces/socket.h | |
parent | ca66305af16e2f8d8f271218ea71f132e6c21916 (diff) |
[HICN-11] Rework on transport protocols improving components modularity
Change-Id: I6683ec5b494238dc93591c103d25275e89b9f267
Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'libtransport/src/hicn/transport/interfaces/socket.h')
-rw-r--r-- | libtransport/src/hicn/transport/interfaces/socket.h | 133 |
1 files changed, 6 insertions, 127 deletions
diff --git a/libtransport/src/hicn/transport/interfaces/socket.h b/libtransport/src/hicn/transport/interfaces/socket.h index 14ef86422..7d50d0fbd 100644 --- a/libtransport/src/hicn/transport/interfaces/socket.h +++ b/libtransport/src/hicn/transport/interfaces/socket.h @@ -24,6 +24,7 @@ #include <hicn/transport/core/name.h> #include <hicn/transport/interfaces/socket_options_default_values.h> #include <hicn/transport/interfaces/socket_options_keys.h> +#include <hicn/transport/protocols/statistics.h> #include <hicn/transport/utils/crypto_suite.h> #include <hicn/transport/utils/identity.h> #include <hicn/transport/utils/verifier.h> @@ -40,7 +41,8 @@ namespace transport { namespace protocol { class IcnObserver; -} +class TransportStatistics; +} // namespace protocol namespace interface { @@ -77,6 +79,7 @@ using BasePortal = HicnForwarderPortal; using PayloadType = core::PayloadType; using Prefix = core::Prefix; using Array = utils::Array<uint8_t>; +using ContentBuffer = std::shared_ptr<std::vector<uint8_t>>; using ConsumerInterestCallback = std::function<void(ConsumerSocket &, const core::Interest &)>; @@ -84,9 +87,8 @@ using ConsumerInterestCallback = using ConsumerContentCallback = std::function<void(ConsumerSocket &, std::size_t, const std::error_code &)>; -using ConsumerTimerCallback = - std::function<void(ConsumerSocket &, std::size_t, - std::chrono::milliseconds &, float, uint32_t, uint32_t)>; +using ConsumerTimerCallback = std::function<void( + ConsumerSocket &, const protocol::TransportStatistics &stats)>; using ProducerContentCallback = std::function<void( ProducerSocket &, const std::error_code &, uint64_t bytes_written)>; @@ -132,129 +134,6 @@ class Socket { virtual void connect() = 0; - virtual int setSocketOption(int socket_option_key, - uint32_t socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - double socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - bool socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - core::Name socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - std::list<Prefix> socket_option_value) = 0; - - virtual int setSocketOption( - int socket_option_key, - ProducerContentObjectCallback socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - ProducerInterestCallback socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - ProducerContentCallback socket_option_value) = 0; - - virtual int setSocketOption( - int socket_option_key, - ConsumerContentObjectVerificationCallback socket_option_value) = 0; - - virtual int setSocketOption( - int socket_option_key, - ConsumerContentObjectCallback socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - ConsumerInterestCallback socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - ConsumerContentCallback socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - ConsumerManifestCallback socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - IcnObserver *socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - core::HashAlgorithm socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - utils::CryptoSuite socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - const utils::Identity &socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - ConsumerTimerCallback socket_option_value) = 0; - - virtual int setSocketOption(int socket_option_key, - const std::string &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - uint32_t &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - double &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - bool &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - core::Name &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - std::list<Prefix> &socket_option_value) = 0; - - virtual int getSocketOption( - int socket_option_key, - ProducerContentObjectCallback &socket_option_value) = 0; - - virtual int getSocketOption( - int socket_option_key, ProducerInterestCallback &socket_option_value) = 0; - - virtual int getSocketOption( - int socket_option_key, - ConsumerContentObjectVerificationCallback &socket_option_value) = 0; - - virtual int getSocketOption( - int socket_option_key, - ConsumerContentObjectCallback &socket_option_value) = 0; - - virtual int getSocketOption( - int socket_option_key, ConsumerInterestCallback &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - ConsumerContentCallback &socket_option_value) = 0; - - virtual int getSocketOption( - int socket_option_key, ConsumerManifestCallback &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - ProducerContentCallback &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - std::shared_ptr<Portal> &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - IcnObserver **socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - core::HashAlgorithm &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - utils::CryptoSuite &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - utils::Identity &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - std::string &socket_option_value) = 0; - - virtual int getSocketOption(int socket_option_key, - ConsumerTimerCallback &socket_option_value) = 0; - protected: virtual ~Socket(){}; |