summaryrefslogtreecommitdiffstats
path: root/apps/ping
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2022-08-26 15:02:12 +0000
committerMauro Sardara <msardara@cisco.com>2022-09-01 13:20:29 +0000
commit940228d74920fbfd6707e1324711164360cca52d (patch)
tree1810371558a8f3efd5e9eb2e5ac042c98e354d50 /apps/ping
parent8d7d5327ca86871cdf1d2ce404ca88bb2a58630f (diff)
feat(hicn-plugin): interest manifest
Ref: HICN-748 Change-Id: Ie403de53a93094dca997cec379db6f5d3ce8e6be Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'apps/ping')
-rw-r--r--apps/ping/src/ping_client.cc21
1 files changed, 12 insertions, 9 deletions
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;