|
ndn-embeds 0.1.0
Lightweight NDN protocol stack for embedded systems
|
Forwarding Information Base. More...
#include <ndn/fib.hpp>
Public Member Functions | |
Route management | |
| Error | addRoute (const Name &prefix, FaceId faceId, uint8_t cost=0) |
| Add a route. | |
| void | removeRoute (const Name &prefix, FaceId faceId) |
| Remove a specific next-hop. | |
| void | removeRoute (const Name &prefix) |
| Remove all routes for a prefix. | |
| void | removeFace (FaceId faceId) |
| Remove a specified Face from all entries. | |
Lookup | |
| const FibEntry * | findLongestMatch (const Name &name) const |
| Look up using Longest Prefix Match. | |
| const FibEntry * | findExact (const Name &prefix) const |
| Look up using exact match. | |
| FibEntry * | findExact (const Name &prefix) |
| Look up using exact match (non-const version) | |
Statistics | |
| size_t | size () const |
| Get the current number of entries. | |
| size_t | capacity () const |
| Get the maximum number of entries. | |
Forwarding Information Base.
One of the core components of the forwarder. Determines which Face to forward Interests to. Uses Longest Prefix Match for forwarding lookups.
Add a route.
Registers a forwarding destination for the specified prefix. If the prefix already exists, adds a next-hop.
Definition at line 56 of file fib.cpp.
References ndn::FibEntry::addNexthop(), and findExact().
Referenced by ndn::Forwarder::addRoute(), ndn::Forwarder::addRoute(), and ndn::Forwarder::registerPrefix().
|
inline |
Get the maximum number of entries.
Definition at line 205 of file fib.hpp.
References ndn::FIB_MAX_ENTRIES.
Look up using exact match.
| prefix | Prefix to search for |
Definition at line 134 of file fib.cpp.
Referenced by addRoute(), removeRoute(), and removeRoute().
Look up using Longest Prefix Match.
Returns the entry with the longest prefix that matches the given Name.
| name | Name to search for |
Definition at line 117 of file fib.cpp.
References ndn::Name::componentCount().
| void ndn::Fib::removeFace | ( | FaceId | faceId | ) |
| void ndn::Fib::removeRoute | ( | const Name & | prefix | ) |
Remove all routes for a prefix.
| prefix | Name prefix |
Definition at line 96 of file fib.cpp.
References findExact().
Remove a specific next-hop.
Definition at line 81 of file fib.cpp.
References findExact(), and ndn::FibEntry::removeNexthop().
Referenced by ndn::Forwarder::unregisterPrefix().
|
inline |