21 #include "ndn-interest.h"
24 #include "ns3/unused.h"
25 #include "ns3/packet.h"
27 NS_LOG_COMPONENT_DEFINE (
"ndn.Interest");
35 , m_interestLifetime (Seconds (0))
37 , m_nackType (NORMAL_INTEREST)
44 m_payload = Create<Packet> ();
49 : m_name (Create<
Name> (interest.GetName ()))
50 , m_scope (interest.m_scope)
51 , m_interestLifetime (interest.m_interestLifetime)
52 , m_nonce (interest.m_nonce)
53 , m_nackType (interest.m_nackType)
54 , m_exclude (interest.m_exclude ? Create<
Exclude> (*interest.GetExclude ()) : 0)
55 , m_payload (interest.GetPayload ()->Copy ())
58 NS_LOG_FUNCTION (
"correct copy constructor");
71 m_name = Create<Name> (name);
104 m_interestLifetime = lifetime;
111 return m_interestLifetime;
130 m_nackType = nackType;
172 os <<
"<Interest>\n <Name>" <<
GetName () <<
"</Name>\n";
181 case NACK_CONGESTION:
190 os <<
" <Scope>" <<
GetScope () <<
"</Scope>\n";
194 os <<
" <Nonce>" <<
GetNonce () <<
"</Nonce>\n";
void SetScope(int8_t scope)
Set Scope Scope limits where the Interest may propagate.
Class to represent Exclude component in NDN interests.
const Name & GetName() const
Get interest name.
void SetNack(uint8_t nackType)
Mark the Interest as a Negative Acknowledgement Three types of NACKs are supported.
Ptr< const Name > GetNamePtr() const
Get smart pointer to the interest name (to avoid extra memory usage)
Class for Interest parsing exception.
void SetInterestLifetime(Time time)
Set InterestLifetime InterestLifetime indicates the (approximate) time remaining before the interest ...
void Print(std::ostream &os) const
Print Interest in plain-text to the specified output stream.
uint32_t GetNonce() const
Get Nonce value Nonce carries a randomly-genenerated bytestring that is used to detect and discard du...
Ptr< const Packet > GetPayload() const
Get virtual "payload" to interest packet.
Time GetInterestLifetime() const
Get InterestLifetime value InterestLifetime indicates the (approximate) time remaining before the int...
void SetExclude(Ptr< Exclude > exclude)
Set exclude filter of interest packet.
Interest(Ptr< Packet > payload=Create< Packet >())
Constructor.
uint8_t GetNack() const
Get NACK type Returns NACK_LOOP, NACK_CONGESTION or NACK_GIVEUP_PIT.
NDN Interest (wire formats are defined in wire)
void SetPayload(Ptr< Packet > payload)
Set virtual "payload" of interest packet.
int8_t GetScope() const
Get Scope value Scope limits where the Interest may propagate.
void SetName(Ptr< Name > name)
Set interest name.
void SetNonce(uint32_t nonce)
Set Nonce Nonce carries a randomly-genenerated bytestring that is used to detect and discard duplicat...
Ptr< const Exclude > GetExclude() const
Get exclude filter of interest packet.