diff options
Diffstat (limited to 'libtransport/includes/hicn/transport/interfaces')
9 files changed, 34 insertions, 89 deletions
diff --git a/libtransport/includes/hicn/transport/interfaces/CMakeLists.txt b/libtransport/includes/hicn/transport/interfaces/CMakeLists.txt index 08f880930..40623dfe1 100644 --- a/libtransport/includes/hicn/transport/interfaces/CMakeLists.txt +++ b/libtransport/includes/hicn/transport/interfaces/CMakeLists.txt @@ -11,8 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) - list(APPEND HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/socket_consumer.h ${CMAKE_CURRENT_SOURCE_DIR}/socket_producer.h diff --git a/libtransport/includes/hicn/transport/interfaces/callbacks.h b/libtransport/includes/hicn/transport/interfaces/callbacks.h index 95b4d1977..22e111799 100644 --- a/libtransport/includes/hicn/transport/interfaces/callbacks.h +++ b/libtransport/includes/hicn/transport/interfaces/callbacks.h @@ -15,8 +15,8 @@ #pragma once -#include <hicn/transport/interfaces/statistics.h> #include <hicn/transport/auth/policies.h> +#include <hicn/transport/interfaces/statistics.h> #include <functional> #include <system_error> diff --git a/libtransport/includes/hicn/transport/interfaces/p2psecure_socket_producer.h b/libtransport/includes/hicn/transport/interfaces/p2psecure_socket_producer.h index 7b284c520..d86744514 100644 --- a/libtransport/includes/hicn/transport/interfaces/p2psecure_socket_producer.h +++ b/libtransport/includes/hicn/transport/interfaces/p2psecure_socket_producer.h @@ -15,8 +15,8 @@ #pragma once -#include <hicn/transport/interfaces/socket_producer.h> #include <hicn/transport/auth/identity.h> +#include <hicn/transport/interfaces/socket_producer.h> namespace transport { diff --git a/libtransport/includes/hicn/transport/interfaces/portal.h b/libtransport/includes/hicn/transport/interfaces/portal.h index 22c8591f4..66fc84256 100644 --- a/libtransport/includes/hicn/transport/interfaces/portal.h +++ b/libtransport/includes/hicn/transport/interfaces/portal.h @@ -15,14 +15,11 @@ #pragma once +#include <hicn/transport/core/asio_wrapper.h> #include <hicn/transport/core/content_object.h> #include <hicn/transport/core/interest.h> #include <hicn/transport/core/prefix.h> -#ifndef ASIO_STANDALONE -#define ASIO_STANDALONE -#endif -#include <asio/io_service.hpp> #include <functional> #define UNSET_CALLBACK 0 @@ -71,7 +68,7 @@ class Portal { class ConsumerCallback { public: virtual void onContentObject(core::Interest &i, core::ContentObject &c) = 0; - virtual void onTimeout(core::Interest::Ptr &&i) = 0; + virtual void onTimeout(core::Interest::Ptr &i, const core::Name &n) = 0; virtual void onError(std::error_code ec) = 0; }; @@ -87,7 +84,8 @@ class Portal { using OnContentObjectCallback = std::function<void(core::Interest &, core::ContentObject &)>; - using OnInterestTimeoutCallback = std::function<void(core::Interest::Ptr &&)>; + using OnInterestTimeoutCallback = + std::function<void(core::Interest::Ptr &, const core::Name &)>; Portal(); @@ -202,4 +200,4 @@ class Portal { }; } // namespace interface -} // namespace transport
\ No newline at end of file +} // namespace transport diff --git a/libtransport/includes/hicn/transport/interfaces/rtc_socket_producer.h b/libtransport/includes/hicn/transport/interfaces/rtc_socket_producer.h deleted file mode 100644 index 218240f83..000000000 --- a/libtransport/includes/hicn/transport/interfaces/rtc_socket_producer.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2020 Cisco and/or its affiliates. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include <hicn/transport/interfaces/socket_producer.h> - -namespace transport { - -namespace interface { - -class RTCProducerSocket : public ProducerSocket { - public: - RTCProducerSocket(); - ~RTCProducerSocket() = default; -}; - -} // namespace interface - -} // end namespace transport diff --git a/libtransport/includes/hicn/transport/interfaces/socket_consumer.h b/libtransport/includes/hicn/transport/interfaces/socket_consumer.h index 621e7ce6f..5e0e81b9f 100644 --- a/libtransport/includes/hicn/transport/interfaces/socket_consumer.h +++ b/libtransport/includes/hicn/transport/interfaces/socket_consumer.h @@ -15,18 +15,14 @@ #pragma once +#include <hicn/transport/auth/verifier.h> #include <hicn/transport/config.h> +#include <hicn/transport/core/asio_wrapper.h> #include <hicn/transport/core/name.h> #include <hicn/transport/core/prefix.h> #include <hicn/transport/interfaces/callbacks.h> #include <hicn/transport/interfaces/socket_options_default_values.h> #include <hicn/transport/interfaces/socket_options_keys.h> -#include <hicn/transport/auth/verifier.h> - -#ifndef ASIO_STANDALONE -#define ASIO_STANDALONE -#endif -#include <asio/io_service.hpp> #define CONSUMER_FINISHED 0 #define CONSUMER_BUSY 1 diff --git a/libtransport/includes/hicn/transport/interfaces/socket_producer.h b/libtransport/includes/hicn/transport/interfaces/socket_producer.h index 302b03f3f..27b603dfe 100644 --- a/libtransport/includes/hicn/transport/interfaces/socket_producer.h +++ b/libtransport/includes/hicn/transport/interfaces/socket_producer.h @@ -15,18 +15,14 @@ #pragma once +#include <hicn/transport/auth/signer.h> #include <hicn/transport/config.h> +#include <hicn/transport/core/asio_wrapper.h> #include <hicn/transport/core/name.h> #include <hicn/transport/core/prefix.h> #include <hicn/transport/interfaces/callbacks.h> #include <hicn/transport/interfaces/socket_options_default_values.h> #include <hicn/transport/interfaces/socket_options_keys.h> -#include <hicn/transport/auth/signer.h> - -#ifndef ASIO_STANDALONE -#define ASIO_STANDALONE -#endif -#include <asio/io_service.hpp> namespace transport { diff --git a/libtransport/includes/hicn/transport/interfaces/statistics.h b/libtransport/includes/hicn/transport/interfaces/statistics.h index 92c58da23..1ff6f3edd 100644 --- a/libtransport/includes/hicn/transport/interfaces/statistics.h +++ b/libtransport/includes/hicn/transport/interfaces/statistics.h @@ -49,11 +49,13 @@ class TransportStatistics { interest_FEC_tx_(0), bytes_FEC_received_(0), lost_data_(0), + definitely_lost_data_(0), recovered_data_(0), status_(-1), // avg_data_rtt_(0), avg_pending_pkt_(0.0), - received_nacks_(0) {} + received_nacks_(0), + received_fec_(0) {} TRANSPORT_ALWAYS_INLINE void updateRetxCount(uint64_t retx) { retx_count_ += retx; @@ -96,6 +98,10 @@ class TransportStatistics { lost_data_ += pkt; } + TRANSPORT_ALWAYS_INLINE void updateDefinitelyLostData(uint64_t pkt) { + definitely_lost_data_ += pkt; + } + TRANSPORT_ALWAYS_INLINE void updateRecoveredData(uint64_t bytes) { recovered_data_ += bytes; } @@ -110,6 +116,10 @@ class TransportStatistics { received_nacks_ += nacks; } + TRANSPORT_ALWAYS_INLINE void updateReceivedFEC(uint32_t pkt) { + received_fec_ += pkt; + } + TRANSPORT_ALWAYS_INLINE uint64_t getRetxCount() const { return retx_count_; } TRANSPORT_ALWAYS_INLINE uint64_t getBytesRecv() const { @@ -142,6 +152,10 @@ class TransportStatistics { TRANSPORT_ALWAYS_INLINE uint64_t getLostData() const { return lost_data_; } + TRANSPORT_ALWAYS_INLINE uint64_t getDefinitelyLostData() const { + return definitely_lost_data_; + } + TRANSPORT_ALWAYS_INLINE uint64_t getBytesRecoveredData() const { return recovered_data_; } @@ -156,6 +170,10 @@ class TransportStatistics { return received_nacks_; } + TRANSPORT_ALWAYS_INLINE uint32_t getReceivedFEC() const { + return received_fec_; + } + TRANSPORT_ALWAYS_INLINE void setAlpha(double val) { alpha_ = val; } TRANSPORT_ALWAYS_INLINE void reset() { @@ -168,11 +186,13 @@ class TransportStatistics { interest_FEC_tx_ = 0; bytes_FEC_received_ = 0; lost_data_ = 0; + definitely_lost_data_ = 0; recovered_data_ = 0; status_ = 0; // avg_data_rtt_ = 0; avg_pending_pkt_ = 0; received_nacks_ = 0; + received_fec_ = 0; } private: @@ -187,10 +207,12 @@ class TransportStatistics { uint64_t interest_FEC_tx_; uint64_t bytes_FEC_received_; uint64_t lost_data_; + uint64_t definitely_lost_data_; uint64_t recovered_data_; int status_; // transport status (e.g. sync status, congestion etc.) double avg_pending_pkt_; uint32_t received_nacks_; + uint32_t received_fec_; }; } // namespace interface diff --git a/libtransport/includes/hicn/transport/interfaces/verification_policy.h b/libtransport/includes/hicn/transport/interfaces/verification_policy.h deleted file mode 100644 index cb5140ac1..000000000 --- a/libtransport/includes/hicn/transport/interfaces/verification_policy.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2020 Cisco and/or its affiliates. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include <cstdint> - -namespace transport { -namespace interface { - -/** - * This policy allows the application to tell the transport what to do in case - * the verification of a content object fails. - */ -enum class VerificationPolicy : std::uint8_t { - DROP_PACKET, - ACCEPT_PACKET, - ABORT_SESSION -}; -} // namespace interface -} // namespace transport
\ No newline at end of file |