fib
System Forwarding Information Base (FIB) management
The FIB represents the system forwarding tables. In this way, it is generally the result of the programming of any routing agents in the system including static and dynamic routing protocols.
This module allows for direct maniuplation of the FIB, as well as a means of reacting to the contents of the table as well as perform queries.
-
namespace eos
-
class fib_route_iter_t
Private Functions
-
fib_route_iter_t(fib_route_iter_impl * const)
Friends
-
friend class fib_route_iter_impl
-
class fib_fec_iter_t
Private Functions
-
fib_fec_iter_t(fib_fec_iter_impl * const)
Friends
-
friend class fib_fec_iter_impl
-
class fib_handler
- #include <fib.h>
This class receives changes route/fec collection.
Public Functions
-
fib_handler(fib_mgr *)
-
fib_mgr * get_fib_mgr() const
-
virtual void on_route_set(fib_route_t const &)
Handler called when a route gets added or updated.
-
virtual void on_route_del(fib_route_key_t const &)
Handler called when a route gets deleted.
-
virtual void on_fec_set(fib_fec_t const &)
Handler called when a FEC gets added or updated.
-
virtual void on_fec_del(fib_fec_key_t const &)
Handler called when a FEC gets deleted.
-
class fib_mgr
- #include <fib.h>
The FIB Manager.
Public Functions
-
virtual ~fib_mgr()
-
virtual fib_route_iter_t fib_route_iter() const = 0
-
virtual fib_fec_iter_t fib_fec_iter() const = 0
-
virtual bool fib_fec_set(fib_fec_t const &) = 0
-
virtual void fib_fec_del(fib_fec_key_t const &) = 0
-
virtual bool fib_fec_exists(fib_fec_key_t const &) = 0
-
virtual fib_fec_t fib_fec(fib_fec_key_t const &) = 0
-
virtual bool fib_route_set(fib_route_t const &) = 0
-
virtual void fib_route_del(fib_route_key_t const &) = 0
-
virtual bool fib_route_exists(fib_route_key_t const &) = 0
-
virtual fib_route_t fib_route(fib_route_key_t const &) = 0
-
virtual mgr_mode_type_t mode_type() = 0
Returns the mode this manager is in. This mode is set during the construction of the manager, i.e.: `sdk.get_fib_mgr(MODE_TYPE_READ_NOTIFYING)`. If MODE_TYPE_READ_ONLY, only the getters and iterators of this manager will function.
Protected Functions
-
fib_mgr()
Friends
-
friend class fib_handler
Type definitions in fib
-
namespace eos
Enums
-
fib_route_type_t enum
Enums for host routes and FIB routes.
Values:
-
fib_fec_type_t enum
Values:
- FEC_TYPE_FORWARD -
- FEC_TYPE_DROP -
- FEC_TYPE_RECEIVE -
- FEC_TYPE_ATTACHED -
- FEC_TYPE_RECEIVE_BCAST -
- FEC_TYPE_NEXTHOP_GROUP -
- FEC_TYPE_KERNEL -
- FEC_TYPE_UNKNOWN -
-
class fib_route_key_t
- #include <fib.h>
An IP route key that goes in FIB.
Public Functions
-
fib_route_key_t()
-
fib_route_key_t(ip_prefix_t const & prefix)
-
ip_prefix_t prefix() const
Getter for ‘prefix’: IP v4/v6 network prefix.
-
void prefix_is(ip_prefix_t const & prefix)
Setter for ‘prefix’.
-
bool operator==(fib_route_key_t const & other) const
-
bool operator!=(fib_route_key_t const & other) const
-
std::string to_string() const
Returns a string representation of the current object’s values.
Friends
-
friend std::ostream & operator<<
A utility stream operator that adds a string representation of fib_route_key_t to the ostream.
-
class fib_route_t
- #include <fib.h>
An IP route that goes in FIB. The “fec_id” represents the fec a.k.a adjacency associated with the route. Note FEC stands for Forwarding Equivalence Class.
Public Functions
-
fib_route_t()
-
fib_route_t(fib_route_key_t const & route_key)
-
fib_route_key_t route_key() const
Getter for ‘route_key’: IP v4/v6 network route key consisting of prefix.
-
void route_key_is(fib_route_key_t const & route_key)
Setter for ‘route_key’.
-
ip_route_preference_t preference() const
Getter for ‘preference’: 0..255 only, defaults to 1.
-
void preference_is(ip_route_preference_t preference)
Setter for ‘preference’.
-
ip_route_metric_t metric() const
-
void metric_is(ip_route_metric_t metric)
-
fib_route_type_t route_type() const
-
void route_type_is(fib_route_type_t route_type)
-
uint64_t fec_id() const
Getter for ‘fec_id’: id that links prefix to the fec a.k.a Adjacency.
-
void fec_id_is(uint64_t fec_id)
Setter for ‘fec_id’.
-
bool operator==(fib_route_t const & other) const
-
bool operator!=(fib_route_t const & other) const
-
std::string to_string() const
Returns a string representation of the current object’s values.
Private Members
-
fib_route_key_t route_key_
-
ip_route_preference_t preference_
-
ip_route_metric_t metric_
-
fib_route_type_t route_type_
-
uint64_t fec_id_
Friends
-
friend std::ostream & operator<<
A utility stream operator that adds a string representation of fib_route_t to the ostream.
-
class fib_fec_key_t
- #include <fib.h>
FEC key that goes in FIB.
Public Functions
-
fib_fec_key_t()
-
fib_fec_key_t(uint64_t fec_id)
-
uint64_t fec_id() const
Getter for ‘fec_id’: fec_id[56:63] denotes the feature, 0: fib Fec, 1 : resilientEcmp feature, 2: nextHopGroup feature.
-
void fec_id_is(uint64_t fec_id)
Setter for ‘fec_id’.
-
bool operator==(fib_fec_key_t const & other) const
-
bool operator!=(fib_fec_key_t const & other) const
-
std::string to_string() const
Returns a string representation of the current object’s values.
Private Members
-
uint64_t fec_id_
Friends
-
friend std::ostream & operator<<
A utility stream operator that adds a string representation of fib_fec_key_t to the ostream.
-
class fib_via_t
- #include <fib.h>
via (nexthop) information.
Public Functions
-
fib_via_t()
-
fib_via_t(ip_addr_t const & hop, intf_id_t intf)
-
ip_addr_t hop() const
-
void hop_is(ip_addr_t const & hop)
-
intf_id_t intf() const
-
void intf_is(intf_id_t intf)
-
bool operator==(fib_via_t const & other) const
-
bool operator!=(fib_via_t const & other) const
-
std::string to_string() const
Returns a string representation of the current object’s values.
Friends
-
friend std::ostream & operator<<
A utility stream operator that adds a string representation of fib_via_t to the ostream.
-
class fib_fec_t
- #include <fib.h>
FEC (Forwarding Equivalence Class), consists of collection (one or more) vias.
Public Functions
-
fib_fec_t()
-
fib_fec_t(fib_fec_key_t fec_key)
-
fib_fec_key_t fec_key() const
Getter for ‘fec_key’: fec_key consisting of fec_id.
-
void fec_key_is(fib_fec_key_t fec_key)
Setter for ‘fec_key’.
-
fib_fec_type_t fec_type() const
-
void fec_type_is(fib_fec_type_t fec_type)
-
std::string nexthop_group_name() const
Getter for ‘nexthop_group_name’: Name of the nexthop group, in case fec_type is FEC_TYPE_NEXTHOP_GROUP.
-
void nexthop_group_name_is(std::string nexthop_group_name)
Setter for ‘nexthop_group_name’.
-
std::forward_list< fib_via_t > const & via() const
Getter for ‘via’: A list of vias that traffic will be distributed amongst. Duplicate vias will be weighted heavily.
-
void via_is(std::forward_list< fib_via_t > const & via)
Setter for ‘via’.
-
void via_set(fib_via_t const & via)
Prepend one via to the list.
-
void via_del(fib_via_t const & via)
Remove all matching via elements.
-
std::string to_string() const
Returns a string representation of the current object’s values.
Private Members
-
fib_fec_key_t fec_key_
-
fib_fec_type_t fec_type_
-
std::string nexthop_group_name_
-
std::forward_list< fib_via_t > via_
Friends
-
friend std::ostream & operator<<
A utility stream operator that adds a string representation of fib_fec_t to the ostream.