structure for PIT entry More...
#include <ndn-pit-entry.h>
Public Types | |
typedef std::set< IncomingFace > | in_container |
incoming faces container type | |
typedef in_container::iterator | in_iterator |
iterator to incoming faces | |
typedef std::set< OutgoingFace > | out_container |
outgoing faces container type | |
typedef out_container::iterator | out_iterator |
iterator to outgoing faces | |
typedef std::set< uint32_t > | nonce_container |
nonce container type | |
Public Member Functions | |
Entry (Pit &container, Ptr< const Interest > header, Ptr< fib::Entry > fibEntry) | |
PIT entry constructor. More... | |
virtual | ~Entry () |
Virtual destructor. | |
virtual void | UpdateLifetime (const Time &lifetime) |
Update lifetime of PIT entry. More... | |
virtual void | OffsetLifetime (const Time &offsetTime) |
Offset the currently set PIT lifetime (allowed both negative and positive offsets) More... | |
const Name & | GetPrefix () const |
Get prefix of the PIT entry. | |
const Time & | GetExpireTime () const |
Get current expiration time of the record. More... | |
bool | IsNonceSeen (uint32_t nonce) const |
Check if nonce nonce for the same prefix has already been seen. More... | |
virtual void | AddSeenNonce (uint32_t nonce) |
Add nonce to the list of seen nonces. More... | |
virtual in_iterator | AddIncoming (Ptr< Face > face) |
Add face to the list of incoming faces. More... | |
virtual void | RemoveIncoming (Ptr< Face > face) |
Remove incoming entry for face face | |
virtual void | ClearIncoming () |
Clear all incoming faces either after all of them were satisfied or NACKed. | |
virtual out_iterator | AddOutgoing (Ptr< Face > face) |
Add face to the list of outgoing faces. More... | |
virtual void | ClearOutgoing () |
Clear all incoming faces either after all of them were satisfied or NACKed. | |
virtual void | RemoveAllReferencesToFace (Ptr< Face > face) |
Remove all references to face. More... | |
virtual void | SetWaitingInVain (Ptr< Face > face) |
Flag outgoing face as hopeless. | |
bool | AreAllOutgoingInVain () const |
Check if all outgoing faces are NACKed. | |
bool | AreTherePromisingOutgoingFacesExcept (Ptr< Face > face) const |
Similar to AreAllOutgoingInVain, but ignores face More... | |
virtual void | IncreaseAllowedRetxCount () |
Increase maximum limit of allowed retransmission per outgoing face. | |
uint32_t | GetMaxRetxCount () const |
Get maximum allowed number of retransmissions via outgoing faces. | |
Ptr< fib::Entry > | GetFibEntry () |
Get associated FIB entry. | |
const in_container & | GetIncoming () const |
Get associated list (const reference) of incoming faces. | |
const out_container & | GetOutgoing () const |
Get associated list (const reference) of outgoing faces. | |
uint32_t | GetOutgoingCount () const |
Get number of outgoing faces (needed for python bindings) | |
void | AddFwTag (boost::shared_ptr< fw::Tag > tag) |
Add new forwarding strategy tag. | |
template<class T > | |
boost::shared_ptr< T > | GetFwTag () |
Get forwarding strategy tag (tag is not removed) More... | |
template<class T > | |
void | RemoveFwTag () |
Remove the forwarding strategy tag. More... | |
Ptr< const Interest > | GetInterest () const |
Get Interest (if several interests are received, then nonce is from the first Interest) | |
Protected Attributes | |
Pit & | m_container |
Reference to the container (to rearrange indexes, if necessary) | |
Ptr< const Interest > | m_interest |
Interest of the PIT entry (if several interests are received, then nonce is from the first Interest) | |
Ptr< fib::Entry > | m_fibEntry |
FIB entry related to this prefix. | |
nonce_container | m_seenNonces |
map of nonces that were seen for this prefix | |
in_container | m_incoming |
container for incoming interests | |
out_container | m_outgoing |
container for outgoing interests | |
Time | m_expireTime |
Time when PIT entry will be removed. | |
Time | m_lastRetransmission |
Last time when number of retransmissions were increased. | |
uint32_t | m_maxRetxCount |
Maximum allowed number of retransmissions via outgoing faces. | |
std::list< boost::shared_ptr < fw::Tag > > | m_fwTags |
Forwarding strategy tags. | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Entry &entry) |
structure for PIT entry
All set-methods are virtual, in case index rearrangement is necessary in the derived classes
Definition at line 57 of file ndn-pit-entry.h.
ns3::ndn::pit::Entry::Entry | ( | Pit & | container, |
Ptr< const Interest > | header, | ||
Ptr< fib::Entry > | fibEntry | ||
) |
PIT entry constructor.
prefix | Prefix of the PIT entry |
offsetTime | Relative time to the current moment, representing PIT entry lifetime |
fibEntry | A FIB entry associated with the PIT entry |
Definition at line 43 of file ndn-pit-entry.cc.
References UpdateLifetime().
|
virtual |
Add face
to the list of incoming faces.
face | Face to add to the list of incoming faces |
Definition at line 117 of file ndn-pit-entry.cc.
References m_incoming.
|
virtual |
Add face
to the list of outgoing faces.
face | Face to add to the list of outgoing faces |
Definition at line 140 of file ndn-pit-entry.cc.
References m_outgoing.
|
virtual |
Add nonce
to the list of seen nonces.
nonce | nonce to add to the list of seen nonces |
All nonces are stored for the lifetime of the PIT entry
Definition at line 110 of file ndn-pit-entry.cc.
References m_seenNonces.
bool ns3::ndn::pit::Entry::AreTherePromisingOutgoingFacesExcept | ( | Ptr< Face > | face | ) | const |
Similar to AreAllOutgoingInVain, but ignores face
Definition at line 214 of file ndn-pit-entry.cc.
References ns3::ndn::pit::OutgoingFace::m_face, m_outgoing, and ns3::ndn::pit::OutgoingFace::m_waitingInVain.
const Time & ns3::ndn::pit::Entry::GetExpireTime | ( | ) | const |
Get current expiration time of the record.
Definition at line 98 of file ndn-pit-entry.cc.
References m_expireTime.
|
inline |
Get forwarding strategy tag (tag is not removed)
Get and remove forwarding strategy tag.
Definition at line 308 of file ndn-pit-entry.h.
References m_fwTags.
bool ns3::ndn::pit::Entry::IsNonceSeen | ( | uint32_t | nonce | ) | const |
Check if nonce nonce
for the same prefix has already been seen.
nonce | Nonce to check |
Definition at line 104 of file ndn-pit-entry.cc.
References m_seenNonces.
|
virtual |
Offset the currently set PIT lifetime (allowed both negative and positive offsets)
offsetTime | positive or negative offset for the PIT lifetime. |
If PIT expire time becomes less than Simulator::Now, then it is adjusted to Simulator::Now.
Reimplemented in ns3::ndn::pit::EntryImpl< Pit >.
Definition at line 80 of file ndn-pit-entry.cc.
References GetPrefix(), and m_expireTime.
Referenced by ns3::ndn::pit::EntryImpl< Pit >::OffsetLifetime().
|
virtual |
Remove all references to face.
This method should be called before face is completely removed from the stack. Face is removed from the lists of incoming and outgoing faces
Definition at line 162 of file ndn-pit-entry.cc.
References m_incoming, and m_outgoing.
|
inline |
Remove the forwarding strategy tag.
Peek the forwarding strategy tag.
Definition at line 347 of file ndn-pit-entry.h.
References m_fwTags.
|
virtual |
Update lifetime of PIT entry.
lifetime | desired lifetime of the pit entry (relative to the Simulator::Now ()) |
This function will update PIT entry lifetime to the maximum of the current lifetime and the lifetime Simulator::Now () + lifetime
Reimplemented in ns3::ndn::pit::EntryImpl< Pit >.
Definition at line 66 of file ndn-pit-entry.cc.
References ns3::ndn::Pit::GetMaxPitEntryLifetime(), GetPrefix(), m_container, and m_expireTime.
Referenced by Entry(), and ns3::ndn::pit::EntryImpl< Pit >::UpdateLifetime().