summaryrefslogtreecommitdiffstats
path: root/utils/src/ping_server.cc
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2020-02-21 11:52:28 +0100
committerMauro Sardara <msardara@cisco.com>2020-02-26 13:19:16 +0100
commitf4433f28b509a9f67ca85d79000ccf9c2f4b7a24 (patch)
tree0f754bc9d8222f3ace11849165753acd85be3b38 /utils/src/ping_server.cc
parent0e7669445b6be1163189521eabed7dd0124043c8 (diff)
[HICN-534] Major rework on libtransport organization
Change-Id: I361b83a18b4fd59be136d5f0817fc28e17e89884 Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'utils/src/ping_server.cc')
-rw-r--r--utils/src/ping_server.cc26
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();