diff options
author | Alberto Compagno <acompagn+fdio@cisco.com> | 2019-02-18 10:56:49 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2019-02-18 10:56:49 +0000 |
commit | 2fd90aea1831942cda49d6635e95c86d8e494966 (patch) | |
tree | d7182493aa06976f252a0bdce34228e39ee8d050 /libtransport/src/hicn/transport/core/forwarder_interface.h | |
parent | 7465d7ee3fbae80d24342930ad78682a6e674bb9 (diff) | |
parent | 79e0d4f89c4d532189aae06cc5dfbc14e3269703 (diff) |
Merge "[HICN-50] Added udp application connector."
Diffstat (limited to 'libtransport/src/hicn/transport/core/forwarder_interface.h')
-rw-r--r-- | libtransport/src/hicn/transport/core/forwarder_interface.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/libtransport/src/hicn/transport/core/forwarder_interface.h b/libtransport/src/hicn/transport/core/forwarder_interface.h index e7b6fb1a6..de9f3b568 100644 --- a/libtransport/src/hicn/transport/core/forwarder_interface.h +++ b/libtransport/src/hicn/transport/core/forwarder_interface.h @@ -16,7 +16,7 @@ #pragma once #include <hicn/transport/core/prefix.h> -#include <hicn/transport/core/socket_connector.h> +#include <hicn/transport/core/udp_socket_connector.h> #include <hicn/transport/portability/portability.h> #include <deque> @@ -54,8 +54,6 @@ class ForwarderInterface { } public: - static constexpr uint8_t ack_code = 102; - virtual ~ForwarderInterface() {} TRANSPORT_ALWAYS_INLINE void connect(bool is_consumer = true) { @@ -70,6 +68,20 @@ class ForwarderInterface { return static_cast<Implementation &>(*this).getMtu(); } + TRANSPORT_ALWAYS_INLINE static bool isControlMessage(const uint8_t *message) { + return Implementation::isControlMessageImpl(message); + } + + template <typename R> + TRANSPORT_ALWAYS_INLINE void processControlMessageReply(R &&packet_buffer) { + return static_cast<Implementation &>(*this).processControlMessageReplyImpl( + std::forward<R &&>(packet_buffer)); + } + + TRANSPORT_ALWAYS_INLINE void closeConnection() { + return static_cast<Implementation &>(*this).closeConnection(); + } + template < typename R, typename = std::enable_if_t< @@ -97,7 +109,7 @@ class ForwarderInterface { counters_.tx_bytes += len; // Perfect forwarding - connector_.send(packet, len, std::forward<Handler>(packet_sent)); + connector_.send(packet, len, std::forward<Handler &&>(packet_sent)); } TRANSPORT_ALWAYS_INLINE void shutdown() { connector_.close(); } |