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();
231 const time::milliseconds&
234 return m_interestLifetime;
240 m_interestLifetime = interestLifetime;
250 return m_nonce.hasWire();
278 #ifdef NDN_LP_KEEP_LOCAL_CONTROL_HEADER 284 getLocalControlHeader());
290 getLocalControlHeader()
const);
296 getIncomingFaceId()
const);
302 setIncomingFaceId(uint64_t incomingFaceId));
308 getNextHopFaceId()
const);
314 setNextHopFaceId(uint64_t nextHopFaceId));
315 #endif // NDN_LP_KEEP_LOCAL_CONTROL_HEADER 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 mutable shared_ptr<Link> m_linkCached;
446 size_t m_selectedDelegationIndex;
447 mutable Block m_wire;
456 std::ostringstream os;
463 #endif // NDN_INTEREST_HPP const Block & wireEncode() const
Encode to a wire format.
Copyright (c) 2011-2015 Regents of the University of California.
int getChildSelector() const
bool operator==(const Interest &other) const
const Selectors & getSelectors() const
Interest & setMustBeFresh(bool mustBeFresh)
void setSelectedDelegation(const Name &delegationName)
Set the selected delegation.
const Link & getLink() const
Get the link object for this interest.
std::string toUri() const
Encode the name according to the NDN URI Scheme.
int getMustBeFresh() const
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 matchesName(const Name &name) const
Check if Interest, including selectors, matches the given name.
Class representing a wire element of NDN-TLV packet format.
represents an Interest packet
Copyright (c) 2013-2015 Regents of the University of California.
DEPRECATED(lp::LocalControlHeaderFacade getLocalControlHeader())
bool hasNonce() const
Check if Nonce set.
void unsetSelectedDelegation()
Unset the selected delegation.
int getMaxSuffixComponents() const
Name getSelectedDelegation() const
Get the name of the selected delegation.
const time::milliseconds & getInterestLifetime() const
Interest()
Create a new Interest with an empty name (ndn:/)
const KeyLocator & getPublisherPublicKeyLocator() const
void setLink(const Block &link)
Set the link object for this interest.
represents a Link instance
Error(const std::string &what)
Interest & setExclude(const Exclude &exclude)
Interest & setChildSelector(int childSelector)
Interest & setName(const Name &name)
uint32_t getNonce() const
Get Interest's nonce.
Interest & setNonce(uint32_t nonce)
Set Interest's nonce.
Interest & setPublisherPublicKeyLocator(const KeyLocator &keyLocator)
Abstraction implementing Interest selectors.
Interest & setMinSuffixComponents(int minSuffixComponents)
bool operator!=(const Interest &other) const
bool matchesData(const Data &data) const
Check if Interest can be satisfied by data.
Interest & setMaxSuffixComponents(int maxSuffixComponents)
Name abstraction to represent an absolute name.
const Exclude & getExclude() const
void unsetLink()
Delete the link object for this interest.
bool hasWire() const
Check if already has wire.
Interest & setSelectors(const Selectors &selectors)
void wireDecode(const Block &wire)
Decode from the wire format.
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Fast encoding or block size estimation.
int getMinSuffixComponents() const
bool hasLink() const
Check whether the Interest contains a Link object.
const time::milliseconds DEFAULT_INTEREST_LIFETIME
default value for InterestLifetime
bool hasSelectedDelegation() const
Check whether the Interest includes a selected delegation.
Interest & setInterestLifetime(const time::milliseconds &interestLifetime)
represents an error in TLV encoding or decoding
Class to represent Exclude component in NDN interests.
bool hasSelectors() const
const Name & getName() const