|
ndn-embeds 0.1.0
Lightweight NDN protocol stack for embedded systems
|
Pending Interest Table. More...
#include <ndn/pit.hpp>
Classes | |
| struct | Stats |
| PIT statistics. More... | |
Public Member Functions | |
Interest management | |
| PitInsertResult | insert (const Interest &interest, FaceId incomingFace, PitEntry **outEntry=nullptr) |
| Insert an Interest. | |
| PitEntry * | find (const Name &name) |
| Find an entry by Name. | |
| const PitEntry * | find (const Name &name) const |
| Find an entry by Name (const version) | |
| void | remove (PitEntry *entry) |
| Remove an entry. | |
| void | remove (const Name &name) |
| Remove an entry by Name. | |
Statistics | |
| size_t | size () const |
| Get the current number of entries. | |
| size_t | capacity () const |
| Get the maximum number of entries. | |
| const Stats & | stats () const |
| Get statistics. | |
Timeout handling | |
| using | TimeoutCallback = std::function< void(const PitEntry &)> |
| Timeout callback. | |
| void | processTimeouts (TimeMs now, TimeoutCallback callback=nullptr) |
| Process timed-out entries. | |
Pending Interest Table.
One of the core components of the forwarder. Records received Interests and manages which Faces to forward Data to when the corresponding Data arrives.
| using ndn::Pit::TimeoutCallback = std::function<void(const PitEntry&)> |
|
inline |
Get the maximum number of entries.
Definition at line 220 of file pit.hpp.
References ndn::PIT_MAX_ENTRIES.
| PitInsertResult ndn::Pit::insert | ( | const Interest & | interest, |
| FaceId | incomingFace, | ||
| PitEntry ** | outEntry = nullptr |
||
| ) |
Insert an Interest.
If an entry with the same Name exists, aggregation is performed. If the same nonce is detected, it is treated as a loop.
| interest | Interest to insert |
| incomingFace | ID of the Face that received the Interest |
| outEntry | Stores a pointer to the created/updated entry (optional) |
Definition at line 40 of file pit.cpp.
References ndn::PitEntry::addFace(), ndn::Pit::Stats::aggregations, ndn::currentTimeMs(), ndn::Pit::Stats::duplicates, ndn::Pit::Stats::insertions, ndn::Interest::lifetime(), ndn::Interest::name(), and ndn::Interest::nonce().
Referenced by ndn::Forwarder::expressInterest().
| void ndn::Pit::processTimeouts | ( | TimeMs | now, |
| TimeoutCallback | callback = nullptr |
||
| ) |
Process timed-out entries.
Removes entries that have expired beyond the current time and invokes the callback.
| now | Current time (milliseconds) |
| callback | Timeout callback (optional) |
Definition at line 121 of file pit.cpp.
References ndn::Pit::Stats::timeouts.
Referenced by ndn::Forwarder::processEvents().
| void ndn::Pit::remove | ( | const Name & | name | ) |
| void ndn::Pit::remove | ( | PitEntry * | entry | ) |
Remove an entry.
| entry | Pointer to the entry to remove |
Definition at line 106 of file pit.cpp.
Referenced by ndn::Forwarder::putData(), and remove().
|
inline |
|
inline |