NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
nfd::pit::Entry Class Reference

represents a PIT entry More...

#include <pit-entry.hpp>

Inheritance diagram for nfd::pit::Entry:
Collaboration diagram for nfd::pit::Entry:

Public Member Functions

 Entry (const Interest &interest)
 
const InterestgetInterest () const
 
const NamegetName () const
 
bool canForwardTo (const Face &face) const
 decides whether Interest can be forwarded to face More...
 
bool violatesScope (const Face &face) const
 decides whether forwarding Interest to face would violate scope More...
 
int findNonce (uint32_t nonce, const Face &face) const
 finds where a duplicate Nonce appears More...
 
const InRecordCollectiongetInRecords () const
 
bool hasLocalInRecord () const
 determines whether any InRecord is a local Face More...
 
InRecordCollection::iterator insertOrUpdateInRecord (shared_ptr< Face > face, const Interest &interest)
 inserts a InRecord for face, and updates it with interest More...
 
InRecordCollection::const_iterator getInRecord (const Face &face) const
 get the InRecord for face More...
 
void deleteInRecord (const Face &face)
 deletes one InRecord for face if exists More...
 
void deleteInRecords ()
 deletes all InRecords More...
 
const OutRecordCollectiongetOutRecords () const
 
OutRecordCollection::iterator insertOrUpdateOutRecord (shared_ptr< Face > face, const Interest &interest)
 inserts a OutRecord for face, and updates it with interest More...
 
OutRecordCollection::iterator getOutRecord (const Face &face)
 get the OutRecord for face More...
 
void deleteOutRecord (const Face &face)
 deletes one OutRecord for face if exists More...
 
bool hasUnexpiredOutRecords () const
 
- Public Member Functions inherited from nfd::StrategyInfoHost
template<typename T >
shared_ptr< T > getStrategyInfo () const
 get a StrategyInfo item More...
 
template<typename T >
void setStrategyInfo (shared_ptr< T > strategyInfo)
 set a StrategyInfo item More...
 
template<typename T , typename ... A>
shared_ptr< T > getOrCreateStrategyInfo (A &&... args)
 get or create a StrategyInfo item More...
 
void clearStrategyInfo ()
 clear all StrategyInfo items More...
 

Public Attributes

scheduler::EventId m_unsatisfyTimer
 
scheduler::EventId m_stragglerTimer
 

Friends

class nfd::NameTree
 
class nfd::name_tree::Entry
 
class nfd::Pit
 

Detailed Description

represents a PIT entry

Definition at line 69 of file pit-entry.hpp.

Constructor & Destructor Documentation

§ Entry()

nfd::pit::Entry::Entry ( const Interest interest)
explicit

Definition at line 35 of file pit-entry.cpp.

Member Function Documentation

§ getInterest()

const Interest & nfd::pit::Entry::getInterest ( ) const
inline

Definition at line 192 of file pit-entry.hpp.

Referenced by nfd::insertNonceToDnl().

§ getName()

const Name & nfd::pit::Entry::getName ( ) const
Returns
Interest Name

Definition at line 41 of file pit-entry.cpp.

Referenced by nfd::NameTree::findLongestPrefixMatch(), nfd::NameTree::get(), nfd::insertNonceToDnl(), and violatesScope().

§ canForwardTo()

bool nfd::pit::Entry::canForwardTo ( const Face &  face) const

decides whether Interest can be forwarded to face

Returns
true if OutRecord of this face does not exist or has expired, and there is an InRecord not of this face, and scope is not violated

Definition at line 54 of file pit-entry.cpp.

References ndn::time::steady_clock::now(), and violatesScope().

§ violatesScope()

bool nfd::pit::Entry::violatesScope ( const Face &  face) const

decides whether forwarding Interest to face would violate scope

Returns
true if scope control would be violated
Note
canForwardTo has more comprehensive checks (including scope control) and should be used by most strategies. Outgoing Interest pipeline should only check scope because some strategy (eg. vehicular) needs to retransmit sooner than OutRecord expiry, or forward Interest back to incoming face

Definition at line 78 of file pit-entry.cpp.

References ndn::nfd::FACE_SCOPE_NON_LOCAL, getName(), hasLocalInRecord(), and ndn::Name::isPrefixOf().

Referenced by canForwardTo().

§ findNonce()

int nfd::pit::Entry::findNonce ( uint32_t  nonce,
const Face &  face 
) const

finds where a duplicate Nonce appears

Returns
OR'ed DuplicateNonceWhere

Definition at line 99 of file pit-entry.cpp.

References nfd::pit::DUPLICATE_NONCE_IN_OTHER, nfd::pit::DUPLICATE_NONCE_IN_SAME, nfd::pit::DUPLICATE_NONCE_NONE, nfd::pit::DUPLICATE_NONCE_OUT_OTHER, and nfd::pit::DUPLICATE_NONCE_OUT_SAME.

§ getInRecords()

const InRecordCollection & nfd::pit::Entry::getInRecords ( ) const
inline

§ hasLocalInRecord()

bool nfd::pit::Entry::hasLocalInRecord ( ) const

determines whether any InRecord is a local Face

Returns
true if any InRecord is a local Face, false if all InRecords are non-local Faces

Definition at line 47 of file pit-entry.cpp.

References ndn::nfd::FACE_SCOPE_LOCAL.

Referenced by violatesScope().

§ insertOrUpdateInRecord()

InRecordCollection::iterator nfd::pit::Entry::insertOrUpdateInRecord ( shared_ptr< Face >  face,
const Interest interest 
)

inserts a InRecord for face, and updates it with interest

If InRecord for face exists, the existing one is updated. This method does not add the Nonce as a seen Nonce.

Returns
an iterator to the InRecord

Definition at line 131 of file pit-entry.cpp.

§ getInRecord()

InRecordCollection::const_iterator nfd::pit::Entry::getInRecord ( const Face &  face) const

get the InRecord for face

Returns
an iterator to the InRecord, or .end if it does not exist

Definition at line 145 of file pit-entry.cpp.

§ deleteInRecord()

void nfd::pit::Entry::deleteInRecord ( const Face &  face)

deletes one InRecord for face if exists

Definition at line 152 of file pit-entry.cpp.

§ deleteInRecords()

void nfd::pit::Entry::deleteInRecords ( )

deletes all InRecords

Definition at line 162 of file pit-entry.cpp.

§ getOutRecords()

§ insertOrUpdateOutRecord()

OutRecordCollection::iterator nfd::pit::Entry::insertOrUpdateOutRecord ( shared_ptr< Face >  face,
const Interest interest 
)

inserts a OutRecord for face, and updates it with interest

If OutRecord for face exists, the existing one is updated.

Returns
an iterator to the OutRecord

Definition at line 168 of file pit-entry.cpp.

§ getOutRecord()

OutRecordCollection::iterator nfd::pit::Entry::getOutRecord ( const Face &  face)

get the OutRecord for face

Returns
an iterator to the OutRecord, or .end if it does not exist

Definition at line 182 of file pit-entry.cpp.

Referenced by nfd::insertNonceToDnl().

§ deleteOutRecord()

void nfd::pit::Entry::deleteOutRecord ( const Face &  face)

deletes one OutRecord for face if exists

Definition at line 189 of file pit-entry.cpp.

§ hasUnexpiredOutRecords()

bool nfd::pit::Entry::hasUnexpiredOutRecords ( ) const
Returns
true if there is one or more unexpired OutRecords

Definition at line 199 of file pit-entry.cpp.

References ndn::time::steady_clock::now().

Referenced by nfd::fw::RetxSuppressionFixed::decide(), and nfd::fw::RetxSuppressionExponential::decide().

Friends And Related Function Documentation

§ nfd::NameTree

friend class nfd::NameTree
friend

Definition at line 186 of file pit-entry.hpp.

§ nfd::name_tree::Entry

friend class nfd::name_tree::Entry
friend

Definition at line 187 of file pit-entry.hpp.

§ nfd::Pit

friend class nfd::Pit
friend

Definition at line 188 of file pit-entry.hpp.

Member Data Documentation

§ m_unsatisfyTimer

scheduler::EventId nfd::pit::Entry::m_unsatisfyTimer

Definition at line 173 of file pit-entry.hpp.

§ m_stragglerTimer

scheduler::EventId nfd::pit::Entry::m_stragglerTimer

Definition at line 174 of file pit-entry.hpp.


The documentation for this class was generated from the following files: