22 #ifndef NDN_INTEREST_HPP 23 #define NDN_INTEREST_HPP 78 Interest(
const Name& name,
const time::milliseconds& interestLifetime);
90 template<encoding::Tag TAG>
112 return m_wire.hasWire();
229 const time::milliseconds&
232 return m_interestLifetime;
238 m_interestLifetime = interestLifetime;
248 return m_nonce.hasWire();
280 return m_localControlHeader;
286 return m_localControlHeader;
324 return !m_selectors.empty();
336 m_selectors = selectors;
344 return m_selectors.getMinSuffixComponents();
358 return m_selectors.getMaxSuffixComponents();
372 return m_selectors.getPublisherPublicKeyLocator();
386 return m_selectors.getExclude();
400 return m_selectors.getChildSelector();
414 return m_selectors.getMustBeFresh();
435 return !(*
this == other);
441 mutable Block m_nonce;
442 time::milliseconds m_interestLifetime;
444 mutable Block m_link;
445 size_t m_selectedDelegationIndex;
446 mutable Block m_wire;
458 std::ostringstream os;
465 #endif // NDN_INTEREST_HPP int getMinSuffixComponents() const
bool hasSelectedDelegation() const
Check whether the Interest includes a selected delegation.
int getMaxSuffixComponents() const
const nfd::LocalControlHeader & getLocalControlHeader() const
const Name & getName() const
Copyright (c) 2011-2015 Regents of the University of California.
bool operator==(const Interest &other) const
bool matchesName(const Name &name) const
Check if Interest, including selectors, matches the given name.
Link getLink() const
Get the link object for this interest.
Interest & setMustBeFresh(bool mustBeFresh)
void setSelectedDelegation(const Name &delegationName)
Set the selected delegation.
Base class to store tag information (e.g., inside Interest and Data packets)
void refreshNonce()
Refresh nonce.
std::ostream & operator<<(std::ostream &os, const Data &data)
bool hasWire() const
Check if already has wire.
bool hasSelectors() const
const Block & wireEncode() const
Encode to a wire format.
Class representing a wire element of NDN-TLV packet format.
represents an Interest packet
Copyright (c) 2013-2014 Regents of the University of California.
std::string toUri() const
Encode the name according to the NDN URI Scheme.
const time::milliseconds & getInterestLifetime() const
int getChildSelector() const
Name getSelectedDelegation() const
Get the name of the selected delegation.
uint32_t getNonce() const
Get Interest's nonce.
void unsetSelectedDelegation()
Unset the selected delegation.
uint64_t getNextHopFaceId() const
Interest()
Create a new Interest with an empty name (ndn:/)
void setLink(const Block &link)
Set the link object for this interest.
const Selectors & getSelectors() const
represents a Link instance
int getMustBeFresh() const
Error(const std::string &what)
Interest & setExclude(const Exclude &exclude)
Interest & setChildSelector(int childSelector)
Interest & setName(const Name &name)
Interest & setNonce(uint32_t nonce)
Set Interest's nonce.
Interest & setPublisherPublicKeyLocator(const KeyLocator &keyLocator)
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Fast encoding or block size estimation.
const Exclude & getExclude() const
Abstraction implementing Interest selectors.
Interest & setMinSuffixComponents(int minSuffixComponents)
uint64_t getIncomingFaceId() const
Interest & setMaxSuffixComponents(int maxSuffixComponents)
Name abstraction to represent an absolute name.
bool matchesData(const Data &data) const
Check if Interest can be satisfied by data.
void unsetLink()
Reset the wire format of the given interest and the contained link.
Interest & setSelectors(const Selectors &selectors)
Interest & setNextHopFaceId(uint64_t nextHopFaceId)
void wireDecode(const Block &wire)
Decode from the wire format.
Interest & setIncomingFaceId(uint64_t incomingFaceId)
bool hasLink() const
Check whether the Interest contains a Link object.
bool operator!=(const Interest &other) const
const KeyLocator & getPublisherPublicKeyLocator() const
const time::milliseconds DEFAULT_INTEREST_LIFETIME
default value for InterestLifetime
Interest & setInterestLifetime(const time::milliseconds &interestLifetime)
represents an error in TLV encoding or decoding
Class to represent Exclude component in NDN interests.
nfd::LocalControlHeader & getLocalControlHeader()
bool hasNonce() const
Check if Nonce set.