Data packet.
More...
#include <data.hpp>
Inherits ndnph::Printable, and ndnph::RefRegion< detail::DataObj >.
◆ Signed
Result of Data::sign operation.
◆ CanSatisfyOptions
Enumerator |
---|
CanSatisfyNone | |
CanSatisfyInCache | |
◆ canSatisfy()
template<typename InterestT >
Determine whether Data can satisfy Interest.
- Template Parameters
-
InterestT | the ndnph::Interest type. |
This method only works reliably on decoded packets. For packets that are being constructed or modified, this method may give incorrect results for parameterized/signed Interests or Interest carrying implicit digest component.
◆ computeImplicitDigest()
bool ndnph::Data::computeImplicitDigest |
( |
uint8_t |
digest[NDNPH_SHA256_LEN] | ) |
const |
|
inline |
Compute implicit digest.
- Precondition
- Data was decoded, not being constructed.
- Returns
- whether success.
◆ decodeFrom() [1/2]
◆ decodeFrom() [2/2]
template<typename Encodable >
bool ndnph::Data::decodeFrom |
( |
Encodable && |
encodable | ) |
|
|
inline |
Encode then decode as Data packet.
This is useful for obtaining a Data packet in decoded state from the result of signing.
◆ encodeTo()
void ndnph::Data::encodeTo |
( |
Encoder & |
encoder | ) |
const |
|
inline |
Prepend the original packet to Encoder.
- Precondition
- only available on decoded packet.
◆ getContent()
◆ getContentType()
uint8_t ndnph::Data::getContentType |
( |
| ) |
const |
|
inline |
◆ getFreshnessPeriod()
uint32_t ndnph::Data::getFreshnessPeriod |
( |
| ) |
const |
|
inline |
◆ getFullName()
Name ndnph::Data::getFullName |
( |
Region & |
region | ) |
const |
|
inline |
Obtain full name with implicit digest.
- See also
computeImplicitDigest()
.
- Returns
- full name, or a falsy value upon failure.
◆ getIsFinalBlock()
bool ndnph::Data::getIsFinalBlock |
( |
| ) |
const |
|
inline |
◆ getName()
const Name& ndnph::Data::getName |
( |
| ) |
const |
|
inline |
◆ getSigInfo()
const DSigInfo* ndnph::Data::getSigInfo |
( |
| ) |
const |
|
inline |
Retrieve SignatureInfo.
- Precondition
- only available on decoded packet.
◆ printTo()
size_t ndnph::Data::printTo |
( |
::Print & |
p | ) |
const |
|
inlinefinalvirtual |
◆ RefRegion()
◆ setContent()
◆ setContentType()
void ndnph::Data::setContentType |
( |
uint8_t |
v | ) |
|
|
inline |
◆ setFreshnessPeriod()
void ndnph::Data::setFreshnessPeriod |
( |
uint32_t |
v | ) |
|
|
inline |
◆ setIsFinalBlock()
void ndnph::Data::setIsFinalBlock |
( |
bool |
v | ) |
|
|
inline |
◆ setName()
void ndnph::Data::setName |
( |
const Name & |
v | ) |
|
|
inline |
◆ sign()
Sign the packet with a private key.
- Returns
- an Encodable object. This object is valid only if Data and PrivateKey are kept alive. It's recommended to pass it to Encoder immediately without saving as variable.
- Note
- Unrecognized fields found during decoding are not preserved in encoding output.
◆ verify()
bool ndnph::Data::verify |
( |
const PublicKey & |
key | ) |
const |
|
inline |
Verify the packet with a public key.
- Precondition
- only available on decoded packet.
- Returns
- verification result.
The documentation for this class was generated from the following file:
- /home/runner/work/esp8266ndn/NDNph/src/ndnph/packet/data.hpp