From 940228d74920fbfd6707e1324711164360cca52d Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Fri, 26 Aug 2022 15:02:12 +0000 Subject: feat(hicn-plugin): interest manifest Ref: HICN-748 Change-Id: Ie403de53a93094dca997cec379db6f5d3ce8e6be Signed-off-by: Mauro Sardara --- apps/ping/src/ping_client.cc | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'apps') diff --git a/apps/ping/src/ping_client.cc b/apps/ping/src/ping_client.cc index 6cc6de548..bf95837cb 100644 --- a/apps/ping/src/ping_client.cc +++ b/apps/ping/src/ping_client.cc @@ -218,9 +218,11 @@ class Client : interface::Portal::TransportCallback { const Name interest_name(config_->name_, (uint32_t)sequence_number_); hicn_packet_format_t format; if (interest_name.getAddressFamily() == AF_INET) { - format = HICN_PACKET_FORMAT_IPV4_TCP; + format = signer_ ? HICN_PACKET_FORMAT_IPV4_TCP_AH + : HICN_PACKET_FORMAT_IPV4_TCP; } else { - format = HICN_PACKET_FORMAT_IPV6_TCP; + format = signer_ ? HICN_PACKET_FORMAT_IPV6_TCP_AH + : HICN_PACKET_FORMAT_IPV6_TCP; } size_t additional_header_size = 0; @@ -251,21 +253,22 @@ class Client : interface::Portal::TransportCallback { std::cout << ">>> send interest " << interest->getName() << std::endl; } - if (config_->dump_) { - std::cout << "----- interest dump -----" << std::endl; - interest->dump(); - std::cout << "-------------------------" << std::endl; - } - if (!config_->quiet_) std::cout << std::endl; send_timestamps_[sequence_number_] = utils::SteadyTime::now(); for (uint64_t i = 1; i < seq_offset; i++) send_timestamps_[sequence_number_ + i] = utils::SteadyTime::now(); - interest->encodeSuffixes(); if (signer_) signer_->signPacket(interest.get()); + if (config_->dump_) { + std::cout << "----- interest dump -----" << std::endl; + interest->dump(); + std::cout << "-------------------------" << std::endl; + } + + interest->encodeSuffixes(); + portal_.sendInterest(interest, interest->getLifetime()); sequence_number_ += seq_offset; -- cgit 1.2.3-korg