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 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::const_iterator getOutRecord (const Face &face) const
 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
 

Detailed Description

represents a PIT entry

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

Constructor & Destructor Documentation

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

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

Member Function Documentation

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

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

Referenced by nfd::insertNonceToDnl().

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

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

Referenced by nfd::insertNonceToDnl(), and violatesScope().

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().

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 getName(), hasLocalInRecord(), nfd::Face::isLocal(), and ndn::Name::isPrefixOf().

Referenced by canForwardTo().

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.

const InRecordCollection & nfd::pit::Entry::getInRecords ( ) const
inline
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.

Referenced by violatesScope().

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.

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.

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

deletes all InRecords

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

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 158 of file pit-entry.cpp.

OutRecordCollection::const_iterator nfd::pit::Entry::getOutRecord ( const Face face) const

get the OutRecord for face

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

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

Referenced by nfd::insertNonceToDnl().

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

deletes one OutRecord for face if exists

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

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

Definition at line 189 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

friend class nfd::NameTree
friend

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

friend class nfd::name_tree::Entry
friend

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

Member Data Documentation

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

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

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

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


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