aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/core/interest.cc
diff options
context:
space:
mode:
authorMauro <you@example.com>2021-06-30 07:57:22 +0000
committerMauro Sardara <msardara@cisco.com>2021-07-06 16:16:04 +0000
commit08233d44a6cfde878d7e10bca38ae935ed1c8fd5 (patch)
tree7ecc534d55bdc7e8dd15ecab084720910bcdf4d9 /libtransport/src/core/interest.cc
parent147ba39bed26887f5eba84757e2463ab8e370a9a (diff)
[HICN-713] Transport Library Major Refactoring 2
Co-authored-by: Luca Muscariello <muscariello@ieee.org> Co-authored-by: Michele Papalini <micpapal@cisco.com> Co-authored-by: Olivier Roques <oroques+fdio@cisco.com> Co-authored-by: Giulio Grassi <gigrassi@cisco.com> Signed-off-by: Mauro Sardara <msardara@cisco.com> Change-Id: I5b2c667bad66feb45abdb5effe22ed0f6c85d1c2
Diffstat (limited to 'libtransport/src/core/interest.cc')
-rw-r--r--libtransport/src/core/interest.cc16
1 files changed, 3 insertions, 13 deletions
diff --git a/libtransport/src/core/interest.cc b/libtransport/src/core/interest.cc
index b4a74762d..9d868ced0 100644
--- a/libtransport/src/core/interest.cc
+++ b/libtransport/src/core/interest.cc
@@ -101,18 +101,6 @@ void Interest::setName(const Name &name) {
}
}
-void Interest::setName(Name &&name) {
- if (hicn_interest_set_name(format_, packet_start_,
- name.getStructReference()) < 0) {
- throw errors::RuntimeException("Error setting interest name.");
- }
-
- if (hicn_interest_get_name(format_, packet_start_,
- name_.getStructReference()) < 0) {
- throw errors::MalformedPacketException();
- }
-}
-
void Interest::setLocator(const ip_address_t &ip_address) {
if (hicn_interest_set_locator(format_, packet_start_, &ip_address) < 0) {
throw errors::RuntimeException("Error setting interest locator.");
@@ -175,8 +163,9 @@ void Interest::encodeSuffixes() {
// We assume interest does not hold signature for the moment.
auto int_manifest_header =
(InterestManifestHeader *)(writableData() + headerSize());
- int_manifest_header->n_suffixes = (uint32_t)suffix_set_.size();
+ int_manifest_header->n_suffixes = suffix_set_.size();
std::size_t additional_length =
+ sizeof(InterestManifestHeader) +
int_manifest_header->n_suffixes * sizeof(uint32_t);
uint32_t *suffix = (uint32_t *)(int_manifest_header + 1);
@@ -184,6 +173,7 @@ void Interest::encodeSuffixes() {
*suffix = *it;
}
+ append(additional_length);
updateLength(additional_length);
}