aboutsummaryrefslogtreecommitdiffstats
path: root/icnet/transport
diff options
context:
space:
mode:
Diffstat (limited to 'icnet/transport')
-rw-r--r--icnet/transport/icnet_transport_common.h (renamed from icnet/transport/icnet_common.h)0
-rw-r--r--icnet/transport/icnet_transport_content_store.cc (renamed from icnet/transport/icnet_content_store.cc)6
-rw-r--r--icnet/transport/icnet_transport_content_store.h (renamed from icnet/transport/icnet_content_store.h)6
-rw-r--r--icnet/transport/icnet_transport_download_observer.h (renamed from icnet/transport/icnet_download_observer.h)4
-rw-r--r--icnet/transport/icnet_transport_protocol.cc (renamed from icnet/transport/icnet_transport.cc)6
-rw-r--r--icnet/transport/icnet_transport_protocol.h (renamed from icnet/transport/icnet_transport.h)8
-rw-r--r--icnet/transport/icnet_transport_raaqm.cc4
-rw-r--r--icnet/transport/icnet_transport_raaqm.h6
-rw-r--r--icnet/transport/icnet_transport_raaqm_data_path.cc4
-rw-r--r--icnet/transport/icnet_transport_raaqm_data_path.h4
-rw-r--r--icnet/transport/icnet_transport_rate_estimation.cc (renamed from icnet/transport/icnet_rate_estimation.cc)8
-rw-r--r--icnet/transport/icnet_transport_rate_estimation.h (renamed from icnet/transport/icnet_rate_estimation.h)8
-rw-r--r--icnet/transport/icnet_transport_socket.h (renamed from icnet/transport/icnet_socket.h)14
-rw-r--r--icnet/transport/icnet_transport_socket_consumer.cc (renamed from icnet/transport/icnet_socket_consumer.cc)6
-rw-r--r--icnet/transport/icnet_transport_socket_consumer.h (renamed from icnet/transport/icnet_socket_consumer.h)10
-rw-r--r--icnet/transport/icnet_transport_socket_options_default_values.h (renamed from icnet/transport/icnet_socket_options_default_values.h)4
-rw-r--r--icnet/transport/icnet_transport_socket_options_keys.h (renamed from icnet/transport/icnet_socket_options_keys.h)4
-rw-r--r--icnet/transport/icnet_transport_socket_producer.cc (renamed from icnet/transport/icnet_socket_producer.cc)28
-rw-r--r--icnet/transport/icnet_transport_socket_producer.h (renamed from icnet/transport/icnet_socket_producer.h)14
-rw-r--r--icnet/transport/icnet_transport_vegas.cc17
-rw-r--r--icnet/transport/icnet_transport_vegas.h6
-rw-r--r--icnet/transport/icnet_transport_vegas_rto_estimator.cc6
-rw-r--r--icnet/transport/icnet_transport_vegas_rto_estimator.h6
23 files changed, 136 insertions, 43 deletions
diff --git a/icnet/transport/icnet_common.h b/icnet/transport/icnet_transport_common.h
index d507b324..d507b324 100644
--- a/icnet/transport/icnet_common.h
+++ b/icnet/transport/icnet_transport_common.h
diff --git a/icnet/transport/icnet_content_store.cc b/icnet/transport/icnet_transport_content_store.cc
index 64694b20..a9f05658 100644
--- a/icnet/transport/icnet_content_store.cc
+++ b/icnet/transport/icnet_transport_content_store.cc
@@ -13,10 +13,12 @@
* limitations under the License.
*/
-#include "icnet_content_store.h"
+#include "icnet_transport_content_store.h"
namespace icnet {
+namespace transport {
+
ContentStore::ContentStore(std::size_t max_packets)
: max_content_store_size_(max_packets) {
}
@@ -73,4 +75,6 @@ std::size_t ContentStore::size() const {
return content_store_hash_table_.size();
}
+}
+
} // end namespace icnet \ No newline at end of file
diff --git a/icnet/transport/icnet_content_store.h b/icnet/transport/icnet_transport_content_store.h
index a626055d..8a2ed4c6 100644
--- a/icnet/transport/icnet_content_store.h
+++ b/icnet/transport/icnet_transport_content_store.h
@@ -16,12 +16,14 @@
#ifndef ICNET_CONTENT_STORE_H_
#define ICNET_CONTENT_STORE_H_
-#include "icnet_socket.h"
+#include "icnet_transport_socket.h"
#include <mutex>
namespace icnet {
+namespace transport {
+
typedef std::pair<std::shared_ptr<ContentObject>, std::list<std::reference_wrapper<const Name>>::iterator>
CcnxContentStoreEntry;
typedef std::list<std::reference_wrapper<const Name>> LRUList;
@@ -54,6 +56,8 @@ class ContentStore {
std::mutex cs_mutex_;
};
+} // end namespace transport
+
} // end namespace icnet
diff --git a/icnet/transport/icnet_download_observer.h b/icnet/transport/icnet_transport_download_observer.h
index 7b640a1c..15ed5436 100644
--- a/icnet/transport/icnet_download_observer.h
+++ b/icnet/transport/icnet_transport_download_observer.h
@@ -18,6 +18,8 @@
namespace icnet {
+namespace transport {
+
class IcnObserver {
public:
virtual ~IcnObserver() {
@@ -26,6 +28,8 @@ class IcnObserver {
virtual void notifyStats(double throughput) = 0;
};
+} // end namespace transport
+
} // end namespace icnet
#endif // ICNET_DOWNLOAD_OBSERVER_H_
diff --git a/icnet/transport/icnet_transport.cc b/icnet/transport/icnet_transport_protocol.cc
index 632d03c4..71b855eb 100644
--- a/icnet/transport/icnet_transport.cc
+++ b/icnet/transport/icnet_transport_protocol.cc
@@ -13,10 +13,12 @@
* limitations under the License.
*/
-#include "icnet_transport.h"
+#include "icnet_transport_protocol.h"
namespace icnet {
+namespace transport {
+
TransportProtocol::TransportProtocol(Socket *icn_socket)
: socket_(icn_socket), is_running_(false) {
}
@@ -29,4 +31,6 @@ bool TransportProtocol::isRunning() {
return is_running_;
}
+} // end namespace transport
+
} // end namespace icnet
diff --git a/icnet/transport/icnet_transport.h b/icnet/transport/icnet_transport_protocol.h
index 738634fb..5ad43fb5 100644
--- a/icnet/transport/icnet_transport.h
+++ b/icnet/transport/icnet_transport_protocol.h
@@ -16,10 +16,12 @@
#ifndef ICNET_TRANSPORT_PROTOCOL_H_
#define ICNET_TRANSPORT_PROTOCOL_H_
-#include "icnet_socket.h"
+#include "icnet_transport_socket.h"
namespace icnet {
+namespace transport {
+
class TransportProtocol {
public:
TransportProtocol(Socket *icn_socket);
@@ -38,6 +40,8 @@ class TransportProtocol {
bool is_running_;
};
-}
+} // end namespace transport
+
+} // end namespace icnet
#endif // ICNET_TRANSPORT_PROTOCOL_H_
diff --git a/icnet/transport/icnet_transport_raaqm.cc b/icnet/transport/icnet_transport_raaqm.cc
index 7216d29e..787631f4 100644
--- a/icnet/transport/icnet_transport_raaqm.cc
+++ b/icnet/transport/icnet_transport_raaqm.cc
@@ -21,6 +21,8 @@
namespace icnet {
+namespace transport {
+
RaaqmTransportProtocol::RaaqmTransportProtocol(Socket *icnet_socket)
: VegasTransportProtocol(icnet_socket), rate_estimator_(NULL) {
init();
@@ -560,4 +562,6 @@ RaaqmTransportProtocol::onInterest(const Interest &interest)
}
#endif
+} // end namespace transport
+
} // end namespace icnet
diff --git a/icnet/transport/icnet_transport_raaqm.h b/icnet/transport/icnet_transport_raaqm.h
index dc5e72bd..adf3d439 100644
--- a/icnet/transport/icnet_transport_raaqm.h
+++ b/icnet/transport/icnet_transport_raaqm.h
@@ -19,10 +19,12 @@
#include "icnet_transport_vegas.h"
#include "icnet_transport_vegas_rto_estimator.h"
#include "icnet_transport_raaqm_data_path.h"
-#include "icnet_rate_estimation.h"
+#include "icnet_transport_rate_estimation.h"
namespace icnet {
+namespace transport {
+
class RaaqmTransportProtocol : public VegasTransportProtocol {
public:
RaaqmTransportProtocol(Socket *icnet_socket);
@@ -95,6 +97,8 @@ class RaaqmTransportProtocol : public VegasTransportProtocol {
double avg_rtt_;
};
+} // end namespace transport
+
} // end namespace icnet
#endif // ICNET_RAAQM_TRANSPORT_PROTOCOL_H_
diff --git a/icnet/transport/icnet_transport_raaqm_data_path.cc b/icnet/transport/icnet_transport_raaqm_data_path.cc
index 1ff3f667..abe8db6c 100644
--- a/icnet/transport/icnet_transport_raaqm_data_path.cc
+++ b/icnet/transport/icnet_transport_raaqm_data_path.cc
@@ -20,6 +20,8 @@
namespace icnet {
+namespace transport {
+
RaaqmDataPath::RaaqmDataPath(double drop_factor,
double minimum_drop_probability,
unsigned new_timer,
@@ -209,4 +211,6 @@ bool RaaqmDataPath::isStale() {
return false;
}
+} // end namespace transport
+
} // end namespace icnet
diff --git a/icnet/transport/icnet_transport_raaqm_data_path.h b/icnet/transport/icnet_transport_raaqm_data_path.h
index 0093f84b..526c0231 100644
--- a/icnet/transport/icnet_transport_raaqm_data_path.h
+++ b/icnet/transport/icnet_transport_raaqm_data_path.h
@@ -31,6 +31,8 @@
namespace icnet {
+namespace transport {
+
class RaaqmDataPath {
public:
@@ -237,6 +239,8 @@ class RaaqmDataPath {
double alpha_;
};
+} // end namespace transport
+
} // end namespace icnet
#endif // ICNET_RAAQM_DATA_PATH_H_
diff --git a/icnet/transport/icnet_rate_estimation.cc b/icnet/transport/icnet_transport_rate_estimation.cc
index b378da06..79b5b3e2 100644
--- a/icnet/transport/icnet_rate_estimation.cc
+++ b/icnet/transport/icnet_transport_rate_estimation.cc
@@ -14,10 +14,12 @@
*/
-#include "icnet_rate_estimation.h"
+#include "icnet_transport_rate_estimation.h"
namespace icnet {
+namespace transport {
+
void *Timer(void *data) {
InterRttEstimator *estimator = (InterRttEstimator *) data;
@@ -108,7 +110,7 @@ void InterRttEstimator::onRttUpdate(double rtt) {
std::cerr << "Error allocating thread." << std::endl;
my_th_ = NULL;
}
- if (/*int err = */pthread_create(my_th_, NULL, icnet::Timer, (void *) this)) {
+ if (/*int err = */pthread_create(my_th_, NULL, Timer, (void *) this)) {
std::cerr << "Error creating the thread" << std::endl;
my_th_ = NULL;
}
@@ -320,5 +322,7 @@ void BatchingPacketsEstimator::onWindowDecrease(double win_current) {
gettimeofday(&(this->begin_), 0);
}
+} // end namespace transport
+
} // end namespace icnet
diff --git a/icnet/transport/icnet_rate_estimation.h b/icnet/transport/icnet_transport_rate_estimation.h
index 86b879c2..7916ccfa 100644
--- a/icnet/transport/icnet_rate_estimation.h
+++ b/icnet/transport/icnet_transport_rate_estimation.h
@@ -19,7 +19,7 @@
#include <unistd.h>
#include "icnet_transport_raaqm_data_path.h"
-#include "icnet_download_observer.h"
+#include "icnet_transport_download_observer.h"
#define BATCH 50
#define KV 20
@@ -28,6 +28,8 @@
namespace icnet {
+namespace transport {
+
class IcnRateEstimator {
public:
IcnRateEstimator() {
@@ -181,7 +183,9 @@ class SimpleEstimator : public IcnRateEstimator {
void *Timer(void *data);
-}// end namespace icnet
+} // end namespace transport
+
+} // end namespace icnet
#endif // ICNET_RATE_ESTIMATION_H_
diff --git a/icnet/transport/icnet_socket.h b/icnet/transport/icnet_transport_socket.h
index f1ce8da0..edfdf1e8 100644
--- a/icnet/transport/icnet_socket.h
+++ b/icnet/transport/icnet_transport_socket.h
@@ -16,10 +16,10 @@
#ifndef ICNET_SOCKET_H_
#define ICNET_SOCKET_H_
-#include "icnet_common.h"
-#include "icnet_socket_options_keys.h"
-#include "icnet_socket_options_default_values.h"
-#include "icnet_download_observer.h"
+#include "icnet_transport_common.h"
+#include "icnet_transport_socket_options_keys.h"
+#include "icnet_transport_socket_options_default_values.h"
+#include "icnet_transport_download_observer.h"
#define SOCKET_OPTION_GET 0
#define SOCKET_OPTION_NOT_GET 1
@@ -31,6 +31,8 @@
namespace icnet {
+namespace transport {
+
class ConsumerSocket;
class ProducerSocket;
@@ -45,7 +47,7 @@ typedef ccnx::PayloadType PayloadType;
typedef ccnx::Array Array;
typedef std::function<void(ConsumerSocket &, const Interest &)> ConsumerInterestCallback;
-typedef std::function<void(ConsumerSocket &, const uint8_t *, size_t)> ConsumerContentCallback;
+typedef std::function<void(ConsumerSocket &, std::vector<uint8_t> &&)> ConsumerContentCallback;
typedef std::function<void(ConsumerSocket &, const ContentObject &)> ConsumerContentObjectCallback;
typedef std::function<bool(ConsumerSocket &, const ContentObject &)> ConsumerContentObjectVerificationCallback;
typedef std::function<void(ConsumerSocket &, const Manifest &)> ConsumerManifestCallback;
@@ -119,6 +121,8 @@ class Socket {
};
};
+} // end namespace transport
+
} // namespace icnet
#endif // ICNET_SOCKET_H_
diff --git a/icnet/transport/icnet_socket_consumer.cc b/icnet/transport/icnet_transport_socket_consumer.cc
index 2aec571b..21fa7327 100644
--- a/icnet/transport/icnet_socket_consumer.cc
+++ b/icnet/transport/icnet_transport_socket_consumer.cc
@@ -13,10 +13,12 @@
* limitations under the License.
*/
-#include "icnet_socket_consumer.h"
+#include "icnet_transport_socket_consumer.h"
namespace icnet {
+namespace transport {
+
ConsumerSocket::ConsumerSocket(Name prefix, int protocol)
: is_running_(false),
name_prefix_(prefix),
@@ -611,4 +613,6 @@ int ConsumerSocket::getSocketOption(int socket_option_key, IcnObserver **socket_
}
}
+} // end namespace transport
+
} // end namespace icnet
diff --git a/icnet/transport/icnet_socket_consumer.h b/icnet/transport/icnet_transport_socket_consumer.h
index 6b9ec811..59a3a8cb 100644
--- a/icnet/transport/icnet_socket_consumer.h
+++ b/icnet/transport/icnet_transport_socket_consumer.h
@@ -16,9 +16,9 @@
#ifndef ICNET_CONSUMER_SOCKET_H_
#define ICNET_CONSUMER_SOCKET_H_
-#include "icnet_common.h"
-#include "icnet_socket.h"
-#include "icnet_transport.h"
+#include "icnet_transport_common.h"
+#include "icnet_transport_socket.h"
+#include "icnet_transport_protocol.h"
#include "icnet_transport_raaqm.h"
#include "icnet_transport_vegas.h"
@@ -27,6 +27,8 @@
namespace icnet {
+namespace transport {
+
class ConsumerSocket : public Socket {
public:
explicit ConsumerSocket(const Name prefix, int protocol);
@@ -156,6 +158,8 @@ class ConsumerSocket : public Socket {
bool rtt_stats_;
};
+} // end namespace transport
+
} // end namespace icnet
#endif // ICNET_CONSUMER_SOCKET_H_
diff --git a/icnet/transport/icnet_socket_options_default_values.h b/icnet/transport/icnet_transport_socket_options_default_values.h
index 4f6d68e9..6214fc96 100644
--- a/icnet/transport/icnet_socket_options_default_values.h
+++ b/icnet/transport/icnet_transport_socket_options_default_values.h
@@ -18,6 +18,8 @@
namespace icnet {
+namespace transport {
+
namespace default_values {
const int interest_lifetime = 1000; // milliseconds
@@ -56,6 +58,8 @@ const int max_content_object_size = 8096;
} // end namespace default_values
+} // end namespace transport
+
} // end namespace icnet
#endif // ICNET_SOCKET_OPTIONS_DEFAULT_VALUES_H_
diff --git a/icnet/transport/icnet_socket_options_keys.h b/icnet/transport/icnet_transport_socket_options_keys.h
index 4b82f67a..460e8383 100644
--- a/icnet/transport/icnet_socket_options_keys.h
+++ b/icnet/transport/icnet_transport_socket_options_keys.h
@@ -18,6 +18,8 @@
namespace icnet {
+namespace transport {
+
typedef enum {
RAAQM = 0, VEGAS = 1
} TransportProtocolAlgorithms;
@@ -90,6 +92,8 @@ typedef enum {
SHA_256 = 701, RSA_256 = 702,
} SignatureType;
+} // end namespace transport
+
} // end namespace icnet
#endif // ICNET_TRANSPORT_OPTIONS_KEYS_H_
diff --git a/icnet/transport/icnet_socket_producer.cc b/icnet/transport/icnet_transport_socket_producer.cc
index 994488a0..190580f8 100644
--- a/icnet/transport/icnet_socket_producer.cc
+++ b/icnet/transport/icnet_transport_socket_producer.cc
@@ -13,10 +13,12 @@
* limitations under the License.
*/
-#include "icnet_socket_producer.h"
+#include "icnet_transport_socket_producer.h"
namespace icnet {
+namespace transport {
+
ProducerSocket::ProducerSocket(Name prefix)
: portal_(new Portal()),
name_prefix_(prefix),
@@ -69,6 +71,10 @@ void ProducerSocket::serveForever() {
}
}
+void ProducerSocket::stop() {
+ portal_->stopEventsLoop();
+}
+
void ProducerSocket::dispatch() {
// Check that the INTEREST_INPUT callback is set.
if (on_interest_input_ == VOID_HANDLER) {
@@ -98,7 +104,7 @@ void ProducerSocket::passContentObjectToCallbacks(const std::shared_ptr<ContentO
if (!making_manifest_) {
on_content_object_to_sign_(*this, *content_object);
} else {
- if (content_object->getContentType() == PayloadType::MANIFEST) {
+ if (content_object->getPayloadType() == PayloadType::MANIFEST) {
on_content_object_to_sign_(*this, *content_object);
} else {
content_object->signWithSha256(key_locator_);
@@ -140,19 +146,19 @@ void ProducerSocket::produce(ContentObject &content_object) {
portal_->sendContentObject(content_object);
}
-void ProducerSocket::produce(Name suffix, const uint8_t *buf, size_t buffer_size, const int response_id, bool is_last) {
+void ProducerSocket::produce(Name name, const uint8_t *buf, size_t buffer_size, const int response_id, bool is_last) {
if (buffer_size == 0) {
return;
}
- int bytes_segmented = 0;
+ if (name.empty() || !name_prefix_.isPrefixOf(name)) {
+ return;
+ }
- Name name(name_prefix_);
+ int bytes_segmented = 0;
- if (!suffix.empty()) {
- name.append(suffix);
- }
+ std::cout << name.toString() << std::endl;
size_t bytes_occupied_by_name = name.size();
@@ -192,8 +198,8 @@ void ProducerSocket::produce(Name suffix, const uint8_t *buf, size_t buffer_size
Name manifest_name(name_prefix_);
- if (!suffix.empty()) {
- manifest_name.append(suffix);
+ if (!name.empty()) {
+ manifest_name.append(name);
}
manifest_name.appendSegment(current_segment);
@@ -717,4 +723,6 @@ int ProducerSocket::setSocketOption(int socket_option_key, IcnObserver *socket_o
return SOCKET_OPTION_NOT_SET;
}
+} // end namespace transport
+
} // end namespace icnet
diff --git a/icnet/transport/icnet_socket_producer.h b/icnet/transport/icnet_transport_socket_producer.h
index d709e305..4f98f9e2 100644
--- a/icnet/transport/icnet_socket_producer.h
+++ b/icnet/transport/icnet_transport_socket_producer.h
@@ -16,8 +16,8 @@
#ifndef ICNET_PRODUCER_SOCKET_H_
#define ICNET_PRODUCER_SOCKET_H_
-#include "icnet_socket.h"
-#include "icnet_content_store.h"
+#include "icnet_transport_socket.h"
+#include "icnet_transport_content_store.h"
#include <queue>
#include <mutex>
@@ -31,6 +31,8 @@
namespace icnet {
+namespace transport {
+
class ProducerSocket : public Socket {
public:
@@ -42,7 +44,7 @@ class ProducerSocket : public Socket {
void dispatch();
- void produce(Name suffix, const uint8_t *buffer, size_t buffer_size, const int request_id = 0, bool is_last = false);
+ void produce(Name name, const uint8_t *buffer, size_t buffer_size, const int request_id = 0, bool is_last = false);
void produce(ContentObject &content_object);
@@ -52,6 +54,8 @@ class ProducerSocket : public Socket {
void serveForever();
+ void stop();
+
void onInterest(const Name &name, const Interest &interest);
int setSocketOption(int socket_option_key, int socket_option_value);
@@ -167,6 +171,8 @@ class ProducerSocket : public Socket {
};
-}
+} // end namespace transport
+
+} // end namespace icnet
#endif // ICNET_PRODUCER_SOCKET_H_
diff --git a/icnet/transport/icnet_transport_vegas.cc b/icnet/transport/icnet_transport_vegas.cc
index d5a3c500..dd5c7c90 100644
--- a/icnet/transport/icnet_transport_vegas.cc
+++ b/icnet/transport/icnet_transport_vegas.cc
@@ -14,10 +14,12 @@
*/
#include "icnet_transport_vegas.h"
-#include "icnet_socket_consumer.h"
+#include "icnet_transport_socket_consumer.h"
namespace icnet {
+namespace transport {
+
VegasTransportProtocol::VegasTransportProtocol(Socket *icnet_socket)
: TransportProtocol(icnet_socket),
is_final_block_number_discovered_(false),
@@ -139,9 +141,9 @@ void VegasTransportProtocol::onContentSegment(const Interest &interest, ContentO
on_interest_satisfied(*dynamic_cast<ConsumerSocket *>(socket_), const_cast<Interest &>(interest));
}
- if (content_object.getContentType() == PayloadType::MANIFEST) {
+ if (content_object.getPayloadType() == PayloadType::MANIFEST) {
onManifest(interest, content_object);
- } else if (content_object.getContentType() == PayloadType::DATA) {
+ } else if (content_object.getPayloadType() == PayloadType::DATA) {
onContentObject(interest, content_object);
} // TODO InterestReturn
@@ -381,8 +383,7 @@ void VegasTransportProtocol::copyContent(ContentObject &content_object) {
socket_->getSocketOption(CONTENT_RETRIEVED, on_payload);
if (on_payload != VOID_HANDLER) {
on_payload(*dynamic_cast<ConsumerSocket *>(socket_),
- (uint8_t *) (content_buffer_.data()),
- content_buffer_.size());
+ std::move(content_buffer_));
}
//reduce window size to prevent its speculative growth in case when consume() is called in loop
@@ -401,7 +402,7 @@ void VegasTransportProtocol::reassemble() {
uint64_t index = last_reassembled_segment_ % default_values::default_buffer_size;
while (receive_buffer_[index % default_values::default_buffer_size]) {
- if (receive_buffer_[index % default_values::default_buffer_size]->getContentType() == PayloadType::DATA) {
+ if (receive_buffer_[index % default_values::default_buffer_size]->getPayloadType() == PayloadType::DATA) {
copyContent(*receive_buffer_[index % default_values::default_buffer_size]);
}
@@ -484,4 +485,6 @@ void VegasTransportProtocol::removeAllPendingInterests() {
portal_->clear();
}
-} // namespace icn-interface
+} // end namespace transport
+
+} // end namespace icnet
diff --git a/icnet/transport/icnet_transport_vegas.h b/icnet/transport/icnet_transport_vegas.h
index a47050d8..cec2aa5a 100644
--- a/icnet/transport/icnet_transport_vegas.h
+++ b/icnet/transport/icnet_transport_vegas.h
@@ -16,11 +16,13 @@
#ifndef ICNET_VEGAS_TRANSPORT_PROTOCOL_H_
#define ICNET_VEGAS_TRANSPORT_PROTOCOL_H_
-#include "icnet_transport.h"
+#include "icnet_transport_protocol.h"
#include "icnet_transport_vegas_rto_estimator.h"
namespace icnet {
+namespace transport {
+
class VegasTransportProtocol : public TransportProtocol {
public:
@@ -103,6 +105,8 @@ class VegasTransportProtocol : public TransportProtocol {
std::unordered_map<uint64_t, bool> fast_retransmitted_segments;
};
+} // end namespace transport
+
} // end namespace icnet
diff --git a/icnet/transport/icnet_transport_vegas_rto_estimator.cc b/icnet/transport/icnet_transport_vegas_rto_estimator.cc
index 6653518e..f1c10637 100644
--- a/icnet/transport/icnet_transport_vegas_rto_estimator.cc
+++ b/icnet/transport/icnet_transport_vegas_rto_estimator.cc
@@ -14,10 +14,12 @@
*/
#include "icnet_transport_vegas_rto_estimator.h"
-#include "icnet_socket_options_default_values.h"
+#include "icnet_transport_socket_options_default_values.h"
namespace icnet {
+namespace transport {
+
RtoEstimator::RtoEstimator(Duration min_rto)
: smoothed_rtt_(RtoEstimator::getInitialRtt().count()),
rtt_variation_(0),
@@ -44,4 +46,6 @@ RtoEstimator::Duration RtoEstimator::computeRto() const {
return Duration(static_cast<Duration::rep>(rto));
}
+} // end namespace transport
+
} // end namespace icnet \ No newline at end of file
diff --git a/icnet/transport/icnet_transport_vegas_rto_estimator.h b/icnet/transport/icnet_transport_vegas_rto_estimator.h
index 7b18533c..799d6fbc 100644
--- a/icnet/transport/icnet_transport_vegas_rto_estimator.h
+++ b/icnet/transport/icnet_transport_vegas_rto_estimator.h
@@ -16,12 +16,14 @@
#ifndef ICNET_VEGAS_TRANSPORT_PROTOCOL_RTT_ESTIMATOR_H_
#define ICNET_VEGAS_TRANSPORT_PROTOCOL_RTT_ESTIMATOR_H_
-#include "icnet_common.h"
+#include "icnet_transport_common.h"
// Implementation inspired from RFC6298 (https://tools.ietf.org/search/rfc6298#ref-JK88)
namespace icnet {
+namespace transport {
+
class RtoEstimator {
public:
typedef std::chrono::microseconds Duration;
@@ -43,6 +45,8 @@ class RtoEstimator {
double last_rto_;
};
+} // end namespace transport
+
} // end namespace icnet