ndn-embeds 0.1.0
Lightweight NDN protocol stack for embedded systems
Loading...
Searching...
No Matches
ndn::FibEntry Class Reference

FIB entry. More...

#include <ndn/fib.hpp>

Public Member Functions

const Nameprefix () const
 Get the Name prefix.
 
Nexthop management
size_t nexthopCount () const
 Get the number of next-hops.
 
const FibNexthopnexthop (size_t index) const
 Get the next-hop at a given index.
 
bool addNexthop (FaceId faceId, uint8_t cost=0)
 Add a next-hop.
 
bool removeNexthop (FaceId faceId)
 Remove a next-hop.
 

Friends

class Fib
 

Detailed Description

FIB entry.

Holds forwarding information for a single Name prefix. Can have multiple next-hops, supporting multipath forwarding.

Definition at line 41 of file fib.hpp.

Member Function Documentation

◆ addNexthop()

bool ndn::FibEntry::addNexthop ( FaceId  faceId,
uint8_t  cost = 0 
)

Add a next-hop.

If the same Face is already registered, updates its cost.

Parameters
faceIdFace ID to add
costCost (default: 0)
Returns
true on success, false if full

Definition at line 20 of file fib.cpp.

References ndn::FIB_MAX_NEXTHOPS.

Referenced by ndn::Fib::addRoute().

◆ nexthop()

const FibNexthop & ndn::FibEntry::nexthop ( size_t  index) const

Get the next-hop at a given index.

Parameters
indexIndex (starting from 0)
Returns
Const reference to FibNexthop

Definition at line 13 of file fib.cpp.

◆ nexthopCount()

size_t ndn::FibEntry::nexthopCount ( ) const
inline

Get the number of next-hops.

Returns
Number of next-hops

Definition at line 57 of file fib.hpp.

◆ prefix()

const Name & ndn::FibEntry::prefix ( ) const
inline

Get the Name prefix.

Returns
Const reference to the Name

Definition at line 47 of file fib.hpp.

◆ removeNexthop()

bool ndn::FibEntry::removeNexthop ( FaceId  faceId)

Remove a next-hop.

Parameters
faceIdFace ID to remove
Returns
true on success, false if not found

Definition at line 40 of file fib.cpp.

Referenced by ndn::Fib::removeRoute().

Friends And Related Symbol Documentation

◆ Fib

friend class Fib
friend

Definition at line 86 of file fib.hpp.


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