diff options
author | Michele Papalini <micpapal@cisco.com> | 2020-02-26 16:59:39 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2020-02-26 16:59:39 +0000 |
commit | da2366b91ec8d10e4fd15903b689a7abaf5a2769 (patch) | |
tree | 14111810d54ac497893a11c69e52bf4f7f2a59b0 /utils/src/ping_server.cc | |
parent | a2c5df5ce653ba6362931cb7eda0fb53b002f8ac (diff) | |
parent | f4433f28b509a9f67ca85d79000ccf9c2f4b7a24 (diff) |
Merge "[HICN-534] Major rework on libtransport organization"
Diffstat (limited to 'utils/src/ping_server.cc')
-rw-r--r-- | utils/src/ping_server.cc | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/utils/src/ping_server.cc b/utils/src/ping_server.cc index cd51ce5c3..d766e2811 100644 --- a/utils/src/ping_server.cc +++ b/utils/src/ping_server.cc @@ -19,10 +19,16 @@ #else #include <openssl/applink.c> #endif -#include <hicn/transport/utils/identity.h> -#include <hicn/transport/utils/signer.h> + +#include <hicn/transport/core/content_object.h> +#include <hicn/transport/core/interest.h> +#include <hicn/transport/security/identity.h> +#include <hicn/transport/security/signer.h> #include <hicn/transport/utils/string_tokenizer.h> +#include <unistd.h> +#include <asio.hpp> + namespace transport { namespace interface { @@ -81,7 +87,8 @@ class CallbackContainer { } } - void processInterest(ProducerSocket &p, const Interest &interest, uint32_t lifetime) { + void processInterest(ProducerSocket &p, const Interest &interest, + uint32_t lifetime) { if (verbose_) { std::cout << "<<< received interest " << interest.getName() << " src port: " << interest.getSrcPort() @@ -230,8 +237,8 @@ int main(int argc, char **argv) { ttl = (uint8_t)std::stoi(optarg); break; case 'l': - data_lifetime = std::stoi(optarg); - break; + data_lifetime = std::stoi(optarg); + break; case 'V': verbose = true; break; @@ -299,10 +306,11 @@ int main(int argc, char **argv) { p.registerPrefix(producer_namespace); p.setSocketOption(GeneralTransportOptions::OUTPUT_BUFFER_SIZE, 0U); - p.setSocketOption(ProducerCallbacksOptions::CACHE_MISS, - (ProducerInterestCallback)bind( - &CallbackContainer::processInterest, stubs, - std::placeholders::_1, std::placeholders::_2, data_lifetime)); + p.setSocketOption( + ProducerCallbacksOptions::CACHE_MISS, + (ProducerInterestCallback)bind(&CallbackContainer::processInterest, stubs, + std::placeholders::_1, + std::placeholders::_2, data_lifetime)); p.connect(); |