represents an Interest packet More...
#include <interest.hpp>
Classes | |
class | Error |
Public Member Functions | |
Interest (const Name &name=Name(), time::milliseconds interestLifetime=DEFAULT_INTEREST_LIFETIME) | |
Create a new Interest with the given name and interest lifetime. More... | |
Interest (const Block &wire) | |
Create from wire encoding. More... | |
int | getChildSelector () const |
uint64_t | getCongestionMark () const |
get the value of the CongestionMark tag More... | |
const Exclude & | getExclude () const |
const DelegationList & | getForwardingHint () const |
time::milliseconds | getInterestLifetime () const |
int | getMaxSuffixComponents () const |
int | getMinSuffixComponents () const |
int | getMustBeFresh () const |
const Name & | getName () const |
uint32_t | getNonce () const |
Get nonce. More... | |
const KeyLocator & | getPublisherPublicKeyLocator () const |
const Selectors & | getSelectors () const |
template<typename T > | |
shared_ptr< T > | getTag () const |
get a tag item More... | |
bool | hasNonce () const |
Check if Nonce set. More... | |
bool | hasSelectors () const |
bool | hasWire () const |
Check if already has wire. More... | |
bool | matchesData (const Data &data) const |
Check if Interest can be satisfied by data . More... | |
bool | matchesInterest (const Interest &other) const |
Check if Interest matches other interest. More... | |
bool | matchesName (const Name &name) const |
Check if Interest, including selectors, matches the given name . More... | |
template<typename Modifier > | |
Interest & | modifyForwardingHint (const Modifier &modifier) |
modify ForwardingHint in-place More... | |
void | refreshNonce () |
Refresh nonce. More... | |
template<typename T > | |
void | removeTag () const |
remove tag item More... | |
Interest & | setChildSelector (int childSelector) |
void | setCongestionMark (uint64_t mark) |
set the CongestionMark tag to the specified value More... | |
Interest & | setExclude (const Exclude &exclude) |
Interest & | setForwardingHint (const DelegationList &value) |
Interest & | setInterestLifetime (time::milliseconds interestLifetime) |
Set Interest's lifetime. More... | |
Interest & | setMaxSuffixComponents (int maxSuffixComponents) |
Interest & | setMinSuffixComponents (int minSuffixComponents) |
Interest & | setMustBeFresh (bool mustBeFresh) |
Interest & | setName (const Name &name) |
Interest & | setNonce (uint32_t nonce) |
Set nonce. More... | |
Interest & | setPublisherPublicKeyLocator (const KeyLocator &keyLocator) |
Interest & | setSelectors (const Selectors &selectors) |
template<typename T > | |
void | setTag (shared_ptr< T > tag) const |
set a tag item More... | |
std::string | toUri () const |
Encode the name according to the NDN URI Scheme. More... | |
void | wireDecode (const Block &wire) |
Decode from the wire format. More... | |
template<encoding::Tag TAG> | |
size_t | wireEncode (EncodingImpl< TAG > &encoder) const |
Fast encoding or block size estimation. More... | |
const Block & | wireEncode () const |
Encode to a wire format. More... | |
represents an Interest packet
Definition at line 42 of file interest.hpp.
|
explicit |
Create a new Interest with the given name and interest lifetime.
std::invalid_argument | InterestLifetime is negative |
make_shared
. Otherwise, .shared_from_this() will trigger undefined behavior. Definition at line 38 of file interest.cpp.
|
explicit |
Create from wire encoding.
make_shared
. Otherwise, .shared_from_this() will trigger undefined behavior. Definition at line 47 of file interest.cpp.
|
inline |
Definition at line 304 of file interest.hpp.
|
inherited |
get the value of the CongestionMark tag
Definition at line 28 of file packet-base.cpp.
|
inline |
Definition at line 290 of file interest.hpp.
|
inline |
Definition at line 196 of file interest.hpp.
|
inline |
Definition at line 183 of file interest.hpp.
|
inline |
Definition at line 262 of file interest.hpp.
|
inline |
Definition at line 248 of file interest.hpp.
|
inline |
Definition at line 318 of file interest.hpp.
|
inline |
Definition at line 139 of file interest.hpp.
uint32_t ndn::Interest::getNonce | ( | ) | const |
Get nonce.
If nonce was not set before this call, it will be automatically assigned to a random value
Definition at line 301 of file interest.cpp.
|
inline |
Definition at line 276 of file interest.hpp.
|
inline |
Definition at line 234 of file interest.hpp.
|
inlineinherited |
get a tag item
T | type of the tag, which must be a subclass of ndn::Tag |
nullptr | if no Tag of type T is stored |
Definition at line 67 of file tag-host.hpp.
|
inline |
Check if Nonce set.
Definition at line 155 of file interest.hpp.
|
inline |
Definition at line 228 of file interest.hpp.
|
inline |
Check if already has wire.
Definition at line 93 of file interest.hpp.
bool ndn::Interest::matchesData | ( | const Data & | data | ) | const |
Check if Interest can be satisfied by data
.
This method considers Name, MinSuffixComponents, MaxSuffixComponents, PublisherPublicKeyLocator, and Exclude. This method does not consider ChildSelector and MustBeFresh.
Definition at line 207 of file interest.cpp.
bool ndn::Interest::matchesInterest | ( | const Interest & | other | ) | const |
Check if Interest matches other
interest.
Interest matches other
if both have the same name, selectors, and link. Other fields (e.g., Nonce) may be different.
Definition at line 291 of file interest.cpp.
bool ndn::Interest::matchesName | ( | const Name & | name | ) | const |
Check if Interest, including selectors, matches the given name
.
name | The name to be matched. If this is a Data name, it shall contain the implicit digest component |
Definition at line 180 of file interest.cpp.
|
inline |
modify ForwardingHint in-place
Modifier | a unary function that accepts DelegationList& |
This is equivalent to, but more efficient (avoids copying) than:
Definition at line 216 of file interest.hpp.
void ndn::Interest::refreshNonce | ( | ) |
Refresh nonce.
It's guaranteed that new nonce value differs from the existing one.
If nonce is already set, it will be updated to a different random value. If nonce is not set, this method does nothing.
Definition at line 318 of file interest.cpp.
|
inlineinherited |
remove tag item
Definition at line 94 of file tag-host.hpp.
|
inline |
Definition at line 310 of file interest.hpp.
|
inherited |
set the CongestionMark tag to the specified value
Definition at line 41 of file packet-base.cpp.
Definition at line 296 of file interest.hpp.
Interest & ndn::Interest::setForwardingHint | ( | const DelegationList & | value | ) |
Definition at line 343 of file interest.cpp.
Interest & ndn::Interest::setInterestLifetime | ( | time::milliseconds | interestLifetime | ) |
Set Interest's lifetime.
std::invalid_argument | specified lifetime is < 0 |
Definition at line 332 of file interest.cpp.
|
inline |
Definition at line 268 of file interest.hpp.
|
inline |
Definition at line 254 of file interest.hpp.
|
inline |
Definition at line 324 of file interest.hpp.
Definition at line 145 of file interest.hpp.
Interest & ndn::Interest::setNonce | ( | uint32_t | nonce | ) |
Set nonce.
Definition at line 310 of file interest.cpp.
|
inline |
Definition at line 282 of file interest.hpp.
Definition at line 240 of file interest.hpp.
|
inlineinherited |
set a tag item
T | type of the tag, which must be a subclass of ndn::Tag |
Definition at line 80 of file tag-host.hpp.
std::string ndn::Interest::toUri | ( | ) | const |
Encode the name according to the NDN URI Scheme.
If there are interest selectors, this method will append "?" and add the selectors as a query string. For example, "/test/name?ndn.ChildSelector=1"
Definition at line 170 of file interest.cpp.
void ndn::Interest::wireDecode | ( | const Block & | wire | ) |
Decode from the wire format.
Definition at line 119 of file interest.cpp.
size_t ndn::Interest::wireEncode | ( | EncodingImpl< TAG > & | encoder | ) | const |
Fast encoding or block size estimation.
Definition at line 56 of file interest.cpp.
const Block & ndn::Interest::wireEncode | ( | ) | const |
Encode to a wire format.
Definition at line 103 of file interest.cpp.