21 #ifndef _NDN_PIT_ENTRY_H_
22 #define _NDN_PIT_ENTRY_H_
25 #include "ns3/simple-ref-count.h"
27 #include "ns3/ndn-fib.h"
29 #include "ns3/ndn-pit-entry-incoming-face.h"
30 #include "ns3/ndn-pit-entry-outgoing-face.h"
32 #include <boost/multi_index_container.hpp>
33 #include <boost/multi_index/tag.hpp>
34 #include <boost/multi_index/ordered_index.hpp>
37 #include <boost/multi_index/member.hpp>
40 #include <boost/shared_ptr.hpp>
47 namespace fw {
class Tag; }
57 class Entry :
public SimpleRefCount<Entry>
75 Entry (
Pit &container, Ptr<const Interest> header, Ptr<fib::Entry> fibEntry);
241 AddFwTag (boost::shared_ptr< fw::Tag > tag);
247 inline boost::shared_ptr< T >
264 friend std::ostream& operator<< (std::ostream& os,
const Entry &entry);
285 struct EntryIsNotEmpty
288 operator () (Ptr<Entry> entry)
290 return !entry->GetIncoming ().empty ();
295 std::ostream& operator<< (std::ostream& os,
const Entry &entry);
307 inline boost::shared_ptr< T >
310 for (std::list< boost::shared_ptr<fw::Tag> >::iterator item =
m_fwTags.begin ();
314 boost::shared_ptr< T > retPtr = boost::dynamic_pointer_cast<T> (*item);
315 if (retPtr != boost::shared_ptr< T > ())
321 return boost::shared_ptr< T > ();
349 for (std::list< boost::shared_ptr<fw::Tag> >::iterator item =
m_fwTags.begin ();
353 boost::shared_ptr< T > retPtr = boost::dynamic_pointer_cast< T > (*item);
354 if (retPtr != boost::shared_ptr< T > ())
367 #endif // _NDN_PIT_ENTRY_H_
bool AreTherePromisingOutgoingFacesExcept(Ptr< Face > face) const
Similar to AreAllOutgoingInVain, but ignores face
Ptr< fib::Entry > m_fibEntry
FIB entry related to this prefix.
void RemoveFwTag()
Remove the forwarding strategy tag.
Entry(Pit &container, Ptr< const Interest > header, Ptr< fib::Entry > fibEntry)
PIT entry constructor.
out_container m_outgoing
container for outgoing interests
Ptr< const Interest > m_interest
Interest of the PIT entry (if several interests are received, then nonce is from the first Interest) ...
virtual in_iterator AddIncoming(Ptr< Face > face)
Add face to the list of incoming faces.
virtual void RemoveAllReferencesToFace(Ptr< Face > face)
Remove all references to face.
virtual ~Entry()
Virtual destructor.
std::set< OutgoingFace > out_container
outgoing faces container type
Class implementing Pending Interests Table.
Time m_lastRetransmission
Last time when number of retransmissions were increased.
virtual out_iterator AddOutgoing(Ptr< Face > face)
Add face to the list of outgoing faces.
Ptr< fib::Entry > GetFibEntry()
Get associated FIB entry.
virtual void ClearIncoming()
Clear all incoming faces either after all of them were satisfied or NACKed.
bool AreAllOutgoingInVain() const
Check if all outgoing faces are NACKed.
void AddFwTag(boost::shared_ptr< fw::Tag > tag)
Add new forwarding strategy tag.
in_container::iterator in_iterator
iterator to incoming faces
std::list< boost::shared_ptr< fw::Tag > > m_fwTags
Forwarding strategy tags.
virtual void RemoveIncoming(Ptr< Face > face)
Remove incoming entry for face face
in_container m_incoming
container for incoming interests
virtual void OffsetLifetime(const Time &offsetTime)
Offset the currently set PIT lifetime (allowed both negative and positive offsets) ...
boost::shared_ptr< T > GetFwTag()
Get forwarding strategy tag (tag is not removed)
std::set< IncomingFace > in_container
incoming faces container type
Ptr< const Interest > GetInterest() const
Get Interest (if several interests are received, then nonce is from the first Interest) ...
Time m_expireTime
Time when PIT entry will be removed.
const in_container & GetIncoming() const
Get associated list (const reference) of incoming faces.
virtual void ClearOutgoing()
Clear all incoming faces either after all of them were satisfied or NACKed.
const out_container & GetOutgoing() const
Get associated list (const reference) of outgoing faces.
uint32_t m_maxRetxCount
Maximum allowed number of retransmissions via outgoing faces.
virtual void AddSeenNonce(uint32_t nonce)
Add nonce to the list of seen nonces.
virtual void UpdateLifetime(const Time &lifetime)
Update lifetime of PIT entry.
nonce_container m_seenNonces
map of nonces that were seen for this prefix
const Name & GetPrefix() const
Get prefix of the PIT entry.
virtual void SetWaitingInVain(Ptr< Face > face)
Flag outgoing face as hopeless.
uint32_t GetOutgoingCount() const
Get number of outgoing faces (needed for python bindings)
Pit & m_container
Reference to the container (to rearrange indexes, if necessary)
std::set< uint32_t > nonce_container
nonce container type
const Time & GetExpireTime() const
Get current expiration time of the record.
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.
bool IsNonceSeen(uint32_t nonce) const
Check if nonce nonce for the same prefix has already been seen.
out_container::iterator out_iterator
iterator to outgoing faces