NDN Interest (wire formats are defined in wire) More...
#include <ndn-interest.h>
Classes | |
class | Ccnb |
class | ndnSIM |
Public Types | |
enum | { NORMAL_INTEREST = 0, NACK_LOOP = 10, NACK_CONGESTION = 11, NACK_GIVEUP_PIT = 12 } |
NACK Type Specifies the type of Interest packet. | |
Public Member Functions | |
Interest (Ptr< Packet > payload=Create< Packet >()) | |
Constructor. More... | |
Interest (const Interest &interest) | |
Copy constructor. | |
void | SetName (Ptr< Name > name) |
Set interest name. More... | |
void | SetName (const Name &name) |
Another variant to set interest name. More... | |
const Name & | GetName () const |
Get interest name. More... | |
Ptr< const Name > | GetNamePtr () const |
Get smart pointer to the interest name (to avoid extra memory usage) | |
void | SetScope (int8_t scope) |
Set Scope Scope limits where the Interest may propagate. More... | |
int8_t | GetScope () const |
Get Scope value Scope limits where the Interest may propagate. More... | |
void | SetInterestLifetime (Time time) |
Set InterestLifetime InterestLifetime indicates the (approximate) time remaining before the interest times out. More... | |
Time | GetInterestLifetime () const |
Get InterestLifetime value InterestLifetime indicates the (approximate) time remaining before the interest times out. More... | |
void | SetNonce (uint32_t nonce) |
Set Nonce Nonce carries a randomly-genenerated bytestring that is used to detect and discard duplicate Interest messages. More... | |
uint32_t | GetNonce () const |
Get Nonce value Nonce carries a randomly-genenerated bytestring that is used to detect and discard duplicate Interest messages. | |
void | SetNack (uint8_t nackType) |
Mark the Interest as a Negative Acknowledgement Three types of NACKs are supported. More... | |
uint8_t | GetNack () const |
Get NACK type Returns NACK_LOOP, NACK_CONGESTION or NACK_GIVEUP_PIT. More... | |
void | SetExclude (Ptr< Exclude > exclude) |
Set exclude filter of interest packet. More... | |
Ptr< const Exclude > | GetExclude () const |
Get exclude filter of interest packet. | |
void | SetPayload (Ptr< Packet > payload) |
Set virtual "payload" of interest packet. More... | |
Ptr< const Packet > | GetPayload () const |
Get virtual "payload" to interest packet. More... | |
Ptr< const Packet > | GetWire () const |
Get wire formatted packet. More... | |
void | SetWire (Ptr< const Packet > packet) const |
Set (cache) wire formatted packet. | |
void | Print (std::ostream &os) const |
Print Interest in plain-text to the specified output stream. | |
NDN Interest (wire formats are defined in wire)
Definition at line 43 of file ndn-interest.h.
ns3::ndn::Interest::Interest | ( | Ptr< Packet > | payload = Create<Packet> () | ) |
Time ns3::ndn::Interest::GetInterestLifetime | ( | ) | const |
Get InterestLifetime value InterestLifetime indicates the (approximate) time remaining before the interest times out.
The timeout is relative to the arrival time of the interest at the current node.
Definition at line 109 of file ndn-interest.cc.
Referenced by Print().
uint8_t ns3::ndn::Interest::GetNack | ( | ) | const |
Get NACK type Returns NACK_LOOP, NACK_CONGESTION or NACK_GIVEUP_PIT.
Otherwise, in case of normal interest packet, returns NORMAL_INTEREST (equals 0).
Definition at line 135 of file ndn-interest.cc.
Referenced by Print().
const Name & ns3::ndn::Interest::GetName | ( | ) | const |
Get interest name.
Gets name of the interest.
Definition at line 76 of file ndn-interest.cc.
Referenced by ns3::ndn::fib::FibImpl::LongestPrefixMatch(), ns3::ndn::pit::PitImpl< Policy >::Lookup(), and Print().
Ptr< const Packet > ns3::ndn::Interest::GetPayload | ( | ) | const |
Get virtual "payload" to interest packet.
This payload can carry packet tags
Definition at line 161 of file ndn-interest.cc.
int8_t ns3::ndn::Interest::GetScope | ( | ) | const |
Get Scope value Scope limits where the Interest may propagate.
Scope 0 prevents propagation beyond the local ccnd (even to other applications on the same host). Scope 1 limits propagation to the applications on the originating host. Scope 2 limits propagation to no further than the next host. Other values are not defined, and will cause the Interest message to be dropped. Note that this is not a hop count - the value is not decremented as the interest is forwarded.
Definition at line 96 of file ndn-interest.cc.
Referenced by Print().
|
inline |
Get wire formatted packet.
If wire formatted packet has not been set before, 0 will be returned
Definition at line 257 of file ndn-interest.h.
void ns3::ndn::Interest::SetExclude | ( | Ptr< Exclude > | exclude | ) |
Set exclude filter of interest packet.
Empty or 0 means no exclude filter
Definition at line 141 of file ndn-interest.cc.
void ns3::ndn::Interest::SetInterestLifetime | ( | Time | time | ) |
Set InterestLifetime InterestLifetime indicates the (approximate) time remaining before the interest times out.
The timeout is relative to the arrival time of the interest at the current node.
[in] | time | interest lifetime |
Definition at line 102 of file ndn-interest.cc.
Referenced by ns3::ndn::wire::ccnb::InterestVisitor::visit().
void ns3::ndn::Interest::SetNack | ( | uint8_t | nackType | ) |
Mark the Interest as a Negative Acknowledgement Three types of NACKs are supported.
[in] | nackType | NACK_LOOP or NACK_CONGESTION or NACK_GIVEUP_PIT or NORMAL_INTEREST |
Definition at line 128 of file ndn-interest.cc.
Referenced by ns3::ndn::wire::ccnb::InterestVisitor::visit().
void ns3::ndn::Interest::SetName | ( | Ptr< Name > | name | ) |
Set interest name.
name | smart pointer to Name |
Definition at line 62 of file ndn-interest.cc.
Referenced by ns3::ndn::wire::ccnb::InterestVisitor::visit().
void ns3::ndn::Interest::SetName | ( | const Name & | name | ) |
Another variant to set interest name.
name | const reference to Name object |
Definition at line 69 of file ndn-interest.cc.
void ns3::ndn::Interest::SetNonce | ( | uint32_t | nonce | ) |
Set Nonce Nonce carries a randomly-genenerated bytestring that is used to detect and discard duplicate Interest messages.
[in] | nonce | Unique packet identification number |
Definition at line 115 of file ndn-interest.cc.
Referenced by ns3::ndn::wire::ccnb::InterestVisitor::visit().
void ns3::ndn::Interest::SetPayload | ( | Ptr< Packet > | payload | ) |
Set virtual "payload" of interest packet.
This payload can carry packet tags
Definition at line 154 of file ndn-interest.cc.
void ns3::ndn::Interest::SetScope | ( | int8_t | scope | ) |
Set Scope Scope limits where the Interest may propagate.
Scope 0 prevents propagation beyond the local ccnd (even to other applications on the same host). Scope 1 limits propagation to the applications on the originating host. Scope 2 limits propagation to no further than the next host. Other values are not defined, and will cause the Interest message to be dropped. Note that this is not a hop count - the value is not decremented as the interest is forwarded.
[in] | scope | interest scope |
Definition at line 89 of file ndn-interest.cc.
Referenced by ns3::ndn::wire::ccnb::InterestVisitor::visit().