mpls_route

namespace eos
class mpls_route_iter_t
#include <mpls_route.h>

An iterator over MPLS routes.

Private Functions

mpls_route_iter_t(mpls_route_iter_impl * const)

Friends

friend class mpls_route_iter_impl
class mpls_route_via_iter_t
#include <mpls_route.h>

An iterator over MPLS route via.

Private Functions

mpls_route_via_iter_t(mpls_route_via_iter_impl * const)

Friends

friend class mpls_route_via_iter_impl
class mpls_route_mgr
#include <mpls_route.h>

The IP static route manager.

Public Functions

virtual ~mpls_route_mgr()
virtual void resync_init() = 0

Begin resync mode.

virtual void resync_complete() = 0

Complete resync mode, ready for regular updates.

virtual mpls_route_iter_t mpls_route_iter() const = 0

Returns an MPLS route iterator.

virtual mpls_route_via_iter_t mpls_route_via_iter(mpls_route_key_t const &) const = 0

Returns an MPLS via iterator for a given route (key).

virtual bool exists(mpls_route_key_t const &) const = 0

Tests for existence of any routes matching the route key in the switch config.

virtual bool exists(mpls_route_via_t const &) const = 0

Tests if the given via exists.

virtual void mpls_route_set(mpls_route_t const &) = 0

MPLS route management functions.

Inserts or updates MPLS static route in the switch configuration

virtual void mpls_route_del(mpls_route_key_t const &) = 0

Removes the MPLS route and all vias matching the route key.

virtual void mpls_route_via_set(mpls_route_via_t const &) = 0

Adds a via to an mpls_route_t.

virtual void mpls_route_via_del(mpls_route_via_t const &) = 0

Removes a via from an mpls_route_t. When all vias are removed, the route still exists with no nexthop information.

Protected Functions

mpls_route_mgr()

Private Members

mpls_route_mgr

Type definitions in mpls_route

namespace eos

Typedefs

typedef uint8_t mpls_route_metric_t

1..255; default/null is 0.

class mpls_route_key_t
#include <mpls_route.h>

An MPLS route key is used for MPLS RIB configuration.

Public Functions

mpls_route_key_t()
mpls_route_key_t(mpls_label_t top_label, mpls_route_metric_t metric)

Constructor taking an ingress MPLS route label and a metric.

Parameters
  • mpls_label_t -

    The MPLS label to match on ingress for this route.

  • mpls_route_metric_t -

    A metric value between 1 and 255.

mpls_label_t top_label() const

Getter for ‘top_label’: the label to match on ingress route lookup. 0 is the null metric; valid MPLS routes must have a metric in range 1..255.

void top_label_is(mpls_label_t top_label)

Setter for ‘top_label’.

mpls_route_metric_t metric() const

Getter for ‘metric’: the MPLS route metric. Lower metric routes are preferred.

void metric_is(mpls_route_metric_t metric)

Setter for ‘metric’.

bool operator==(mpls_route_key_t const & other) const
bool operator!=(mpls_route_key_t const & other) const
std::string to_string() const

Returns a string representation of the current object’s values.

Private Members

mpls_label_t top_label_
mpls_route_metric_t metric_

Friends

friend std::ostream & operator<<

A utility stream operator that adds a string representation of mpls_route_key_t to the ostream.

class mpls_route_t
#include <mpls_route.h>

An MPLS v4/v6 static route.

Public Functions

mpls_route_t()

Default value constructor.

mpls_route_t(mpls_route_key_t key)

MPLS route constructor taking an MPLS route key.

mpls_route_key_t key() const

Getter for ‘key’: the MPLS route key.

void key_is(mpls_route_key_t key)

Setter for ‘key’.

bool persistent() const

Getter for ‘persistent’: if true, this route is persisted in the startup- config.

void persistent_is(bool persistent)

Setter for ‘persistent’.

bool operator==(mpls_route_t const & other) const
bool operator!=(mpls_route_t const & other) const
std::string to_string() const

Returns a string representation of the current object’s values.

Private Members

mpls_route_key_t key_
bool persistent_

Friends

friend std::ostream & operator<<

A utility stream operator that adds a string representation of mpls_route_t to the ostream.

class mpls_route_via_t
#include <mpls_route.h>

An MPLS route via, defining the action to take for a given MPLS route.

Public Functions

mpls_route_via_t()
mpls_route_via_t(mpls_route_key_t route_key)
mpls_route_key_t route_key() const
void route_key_is(mpls_route_key_t route_key)
ip_addr_t hop() const

Getter for ‘hop’: IP v4/v6 nexthop address (for decap and IP forward).

void hop_is(ip_addr_t const & hop)

Setter for ‘hop’.

intf_id_t intf() const

Getter for ‘intf’: sets the nexthop interface. Use the named interface if not a default intf_id_t.

void intf_is(intf_id_t const & intf)

Setter for ‘intf’.

mpls_label_t pushswap_label() const

Getter for ‘pushswap_label’: push or swap this label.

void pushswap_label_is(mpls_label_t pushswap_label)

Setter for ‘pushswap_label’.

mpls_action_t label_action() const

Getter for ‘label_action’: perform this MPLS operation.

void label_action_is(mpls_action_t label_action)

Setter for ‘label_action’.

mpls_ttl_mode_t ttl_mode() const

Getter for ‘ttl_mode’: applies to push and pop.

void ttl_mode_is(mpls_ttl_mode_t ttl_mode)

Setter for ‘ttl_mode’.

mpls_payload_type_t payload_type() const

Getter for ‘payload_type’: used to assign ethertype after final pop.

void payload_type_is(mpls_payload_type_t payload_type)

Setter for ‘payload_type’.

bool skip_egress_acl() const

Getter for ‘skip_egress_acl’: set if matching packets should ignore the egress ACL.

void skip_egress_acl_is(bool skip_egress_acl)

Setter for ‘skip_egress_acl’.

bool operator==(mpls_route_via_t const & other) const
bool operator!=(mpls_route_via_t const & other) const
std::string to_string() const

Returns a string representation of the current object’s values.

Private Members

mpls_route_key_t route_key_
ip_addr_t hop_
intf_id_t intf_
mpls_label_t pushswap_label_
mpls_action_t label_action_
mpls_ttl_mode_t ttl_mode_
mpls_payload_type_t payload_type_
bool skip_egress_acl_

Friends

friend std::ostream & operator<<

A utility stream operator that adds a string representation of mpls_route_via_t to the ostream.

Table Of Contents

Previous topic

mpls

Next topic

neighbor_table