aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/src/hiperf.cc12
-rw-r--r--utils/src/ping_client.cc11
-rw-r--r--utils/src/ping_server.cc4
3 files changed, 15 insertions, 12 deletions
diff --git a/utils/src/hiperf.cc b/utils/src/hiperf.cc
index 15bcb7405..e037e1309 100644
--- a/utils/src/hiperf.cc
+++ b/utils/src/hiperf.cc
@@ -157,7 +157,7 @@ struct ServerConfiguration {
content_lifetime(600000000_U32),
content_object_size(1440),
download_size(20 * 1024 * 1024),
- hash_algorithm(HashAlgorithm::SHA_256),
+ hash_algorithm(utils::CryptoHashType::SHA_256),
keystore_name(""),
passphrase(""),
keystore_password("cisco"),
@@ -181,7 +181,7 @@ struct ServerConfiguration {
std::uint32_t content_lifetime;
std::uint16_t content_object_size;
std::uint32_t download_size;
- HashAlgorithm hash_algorithm;
+ utils::CryptoHashType hash_algorithm;
std::string keystore_name;
std::string passphrase;
std::string keystore_password;
@@ -841,7 +841,7 @@ class HIperfServer {
std::shared_ptr<utils::Identity> getProducerIdentity(
std::string &keystore_name, std::string &keystore_password,
- HashAlgorithm &hash_algorithm) {
+ utils::CryptoHashType &hash_algorithm) {
if (access(keystore_name.c_str(), F_OK) != -1) {
return std::make_shared<utils::Identity>(keystore_name, keystore_password,
hash_algorithm);
@@ -1335,11 +1335,11 @@ int main(int argc, char *argv[]) {
}
case 'y': {
if (strncasecmp(optarg, "sha256", 6) == 0) {
- server_configuration.hash_algorithm = HashAlgorithm::SHA_256;
+ server_configuration.hash_algorithm = utils::CryptoHashType::SHA_256;
} else if (strncasecmp(optarg, "sha512", 6) == 0) {
- server_configuration.hash_algorithm = HashAlgorithm::SHA_512;
+ server_configuration.hash_algorithm = utils::CryptoHashType::SHA_512;
} else if (strncasecmp(optarg, "crc32", 5) == 0) {
- server_configuration.hash_algorithm = HashAlgorithm::CRC32C;
+ server_configuration.hash_algorithm = utils::CryptoHashType::CRC32C;
} else {
std::cerr << "Ignored unknown hash algorithm. Using SHA 256."
<< std::endl;
diff --git a/utils/src/ping_client.cc b/utils/src/ping_client.cc
index 6dea17418..67440cdc1 100644
--- a/utils/src/ping_client.cc
+++ b/utils/src/ping_client.cc
@@ -14,9 +14,9 @@
*/
#include <hicn/transport/core/interest.h>
+#include <hicn/transport/interfaces/portal.h>
#include <hicn/transport/security/verifier.h>
-
-#include <implementation/socket_consumer.h>
+#include <hicn/transport/utils/log.h>
// Let's make the linker happy
#if !TRANSPORT_LOG_EXTERN_GLOBAL_OUTPUT_LEVEL
@@ -25,6 +25,7 @@ TRANSPORT_LOG_DEFINE_GLOBAL_OUTPUT_LEVEL = 0;
#endif
#endif
+#include <asio/signal_set.hpp>
#include <asio/steady_timer.hpp>
#include <chrono>
#include <map>
@@ -83,7 +84,7 @@ class Configuration {
}
};
-class Client : implementation::BasePortal::ConsumerCallback {
+class Client : interface::Portal::ConsumerCallback {
public:
Client(Configuration *c)
: portal_(), signals_(portal_.getIoService(), SIGINT) {
@@ -213,6 +214,8 @@ class Client : implementation::BasePortal::ConsumerCallback {
}
}
+ void onError(std::error_code ec) override {}
+
void doPing() {
Name interest_name(config_->name_, (uint32_t)sequence_number_);
hicn_format_t format;
@@ -298,7 +301,7 @@ class Client : implementation::BasePortal::ConsumerCallback {
private:
SendTimeMap send_timestamps_;
- implementation::BasePortal portal_;
+ interface::Portal portal_;
asio::signal_set signals_;
uint64_t sequence_number_;
uint64_t last_jump_;
diff --git a/utils/src/ping_server.cc b/utils/src/ping_server.cc
index d766e2811..de02a2072 100644
--- a/utils/src/ping_server.cc
+++ b/utils/src/ping_server.cc
@@ -38,7 +38,7 @@ using CryptoSuite = utils::CryptoSuite;
utils::Identity setProducerIdentity(std::string keystore_name,
std::string keystore_password,
- HashAlgorithm hash_algorithm) {
+ utils::CryptoHashType hash_algorithm) {
if (access(keystore_name.c_str(), F_OK) != -1) {
return utils::Identity(keystore_name, keystore_password, hash_algorithm);
} else {
@@ -291,7 +291,7 @@ int main(int argc, char **argv) {
CallbackContainer *stubs;
utils::Identity identity = setProducerIdentity(
- keystore_path, keystore_password, HashAlgorithm::SHA_256);
+ keystore_path, keystore_password, utils::CryptoHashType::SHA_256);
if (sign) {
stubs = new CallbackContainer(n, object_size, verbose, dump, quite, flags,