diff options
author | Enrico Loparco (eloparco) <eloparco@cisco.com> | 2021-06-24 09:15:41 +0200 |
---|---|---|
committer | Enrico Loparco (eloparco) <eloparco@cisco.com> | 2021-06-24 09:15:41 +0200 |
commit | 229385955109b866a23c4ac2aa03d4d11044c39d (patch) | |
tree | 0591f9c2fc4144d62330337cc2b94c63dfeded54 /libtransport/src/core/manifest.h | |
parent | 6ffbb5ed61733b8dbef39b1a9d437e899e9359d7 (diff) |
[HICN-708] Rebase with master
Signed-off-by: Enrico Loparco (eloparco) <eloparco@cisco.com>
Change-Id: I2122e1d61dd3b2e039972624ffbdbcb3c5610159
Diffstat (limited to 'libtransport/src/core/manifest.h')
-rw-r--r-- | libtransport/src/core/manifest.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/libtransport/src/core/manifest.h b/libtransport/src/core/manifest.h index eadfed752..9b25ebd67 100644 --- a/libtransport/src/core/manifest.h +++ b/libtransport/src/core/manifest.h @@ -15,11 +15,10 @@ #pragma once +#include <core/manifest_format.h> #include <hicn/transport/core/content_object.h> #include <hicn/transport/core/name.h> -#include <core/manifest_format.h> - #include <set> namespace transport { @@ -36,18 +35,20 @@ class Manifest : public Base { "Base must inherit from packet!"); public: + // core::ContentObjectManifest::Ptr + using Encoder = typename FormatTraits::Encoder; using Decoder = typename FormatTraits::Decoder; Manifest(std::size_t signature_size = 0) - : Base(HF_INET6_TCP_AH), + : Base(HF_INET6_TCP_AH, signature_size), encoder_(*this, signature_size), decoder_(*this) { Base::setPayloadType(PayloadType::MANIFEST); } Manifest(const core::Name &name, std::size_t signature_size = 0) - : Base(name, HF_INET6_TCP_AH), + : Base(name, HF_INET6_TCP_AH, signature_size), encoder_(*this, signature_size), decoder_(*this) { Base::setPayloadType(PayloadType::MANIFEST); @@ -55,7 +56,9 @@ class Manifest : public Base { template <typename T> Manifest(T &&base) - : Base(std::forward<T &&>(base)), encoder_(*this), decoder_(*this) { + : Base(std::forward<T &&>(base)), + encoder_(*this, 0, false), + decoder_(*this) { Base::setPayloadType(PayloadType::MANIFEST); } @@ -96,13 +99,13 @@ class Manifest : public Base { return *this; } - Manifest &setHashAlgorithm(utils::CryptoHashType hash_algorithm) { + Manifest &setHashAlgorithm(auth::CryptoHashType hash_algorithm) { hash_algorithm_ = hash_algorithm; encoder_.setHashAlgorithm(hash_algorithm_); return *this; } - utils::CryptoHashType getHashAlgorithm() { return hash_algorithm_; } + auth::CryptoHashType getHashAlgorithm() { return hash_algorithm_; } ManifestType getManifestType() const { return manifest_type_; } @@ -138,7 +141,7 @@ class Manifest : public Base { protected: ManifestType manifest_type_; - utils::CryptoHashType hash_algorithm_; + auth::CryptoHashType hash_algorithm_; bool is_last_; Encoder encoder_; |