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 manipulation 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 void
set_routeinit_task
(int const) = 0
-
virtual void
set_route6init_task
(int const) = 0
-
virtual void
set_fecinit_task
(int const) = 0
-
virtual void
set_fec6init_task
(int const) = 0
-
virtual void
set_fecGeninit_task
(int const) = 0
-
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 bool
register_vrf
(std::string const &, bool) = 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
()
Private Members
-
fib_mgr
Friends
-
friend class
fib_handler
-
virtual
-
class
Type definitions in fib¶
-
namespace
eos
Enums
- fib_route_type_t enum
Enums for host routes and FIB routes.
Values:
ROUTE_TYPE_INVALID
-ROUTE_TYPE_RECEIVE
-Host routes.
ROUTE_TYPE_RECEIVE_BCAST
-ROUTE_TYPE_ATTACHED
-ROUTE_TYPE_UNKNOWN
-Unknows routing protocol.
ROUTE_TYPE_STATIC_CONFIG
-FIB routes.
ROUTE_TYPE_KERNEL
-ROUTE_TYPE_RIP
-ROUTE_TYPE_CONNECTED
-ROUTE_TYPE_REDIRECT
-ROUTE_TYPE_BGP_AGGREGATE
-ROUTE_TYPE_OSPF_AGGREGATE
-ROUTE_TYPE_OSPF_INTRA_AREA
-ROUTE_TYPE_OSPF_INTER_AREA
-ROUTE_TYPE_OSPF_EXTERNAL_TYPE1
-ROUTE_TYPE_OSPF_EXTERNAL_TYPE2
-ROUTE_TYPE_OSPF_NSSA_EXTERNAL_TYPE1
-ROUTE_TYPE_OSPF_NSSA_EXTERNAL_TYPE2
-ROUTE_TYPE_BGP
-ROUTE_TYPE_IBGP
-ROUTE_TYPE_EBGP
-ROUTE_TYPE_LBGP
-ROUTE_TYPE_ISIS
-Unused in EOS 4.15.1, use ROUTE_TYPE_ISIS_LEVEL1/2 instead.
ROUTE_TYPE_ISIS_LEVEL1
-ROUTE_TYPE_ISIS_LEVEL2
-ROUTE_TYPE_NEXTHOP_GROUP
-ROUTE_TYPE_OSPF3
-
- 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)
-
fib_route_key_t
(const fib_route_key_t & other)
-
fib_route_key_t &
operator=
(fib_route_key_t const & other)
-
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
-
uint32_t
hash
() const The hash function for type fib_route_key_t.
-
void
mix_me
(hash_mix & h) const The hash mix function for type fib_route_key_t.
-
std::string
to_string
() const Returns a string representation of the current object’s values.
Private Members
-
std::shared_ptr< fib_route_key_impl_t >
pimpl
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_t
(const fib_route_t & other)
-
fib_route_t &
operator=
(fib_route_t const & other)
-
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
-
uint32_t
hash
() const The hash function for type fib_route_t.
-
void
mix_me
(hash_mix & h) const The hash mix function for type fib_route_t.
-
std::string
to_string
() const Returns a string representation of the current object’s values.
Private Members
-
std::shared_ptr< fib_route_impl_t >
pimpl
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)
-
fib_fec_key_t
(const fib_fec_key_t & other)
-
fib_fec_key_t &
operator=
(fib_fec_key_t const & other)
-
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
-
uint32_t
hash
() const The hash function for type fib_fec_key_t.
-
void
mix_me
(hash_mix & h) const The hash mix function for type fib_fec_key_t.
-
std::string
to_string
() const Returns a string representation of the current object’s values.
Private Members
-
std::shared_ptr< fib_fec_key_impl_t >
pimpl
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
(const fib_via_t & other)
-
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)
-
mpls_label_t
mpls_label
() const
-
void
mpls_label_is
(mpls_label_t mpls_label)
-
bool
operator==
(fib_via_t const & other) const
-
bool
operator!=
(fib_via_t const & other) const
-
uint32_t
hash
() const The hash function for type fib_via_t.
-
std::string
to_string
() const Returns a string representation of the current object’s values.
Private Members
-
std::shared_ptr< fib_via_impl_t >
pimpl
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_t
(const fib_fec_t & other)
-
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.
-
uint32_t
hash
() const The hash function for type fib_fec_t.
-
std::string
to_string
() const Returns a string representation of the current object’s values.
Private Members
-
std::shared_ptr< fib_fec_impl_t >
pimpl
Friends
-
friend std::ostream &
operator<<
A utility stream operator that adds a string representation of fib_fec_t to the ostream.
-