fib module reference

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()

Private Members

fib_mgr

Friends

friend class fib_handler

fib type definitions

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_ISIS -
  • ROUTE_TYPE_NEXTHOP_GROUP -
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.

Private Members

ip_prefix_t prefix_

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 const & 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 const & 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 const & 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 const & 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 const & 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.

Private Members

ip_addr_t hop_
intf_id_t intf_

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 const & 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 const & 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.

Table Of Contents

Previous topic

eth_phy_intf module reference

Next topic

intf module reference