mpls_vrf_label

MPLS Static VRF label management.

This module manages VRF label decapsulation for traffic arriving at the switch (on any interface).

In this example, a static VRF label route is configured for MPLS traffic arriving at the switch with a top label of 16. This label is mapped to a corresponding VRF “foo”.

* // Configures a static VRF label route
* eos::mpls_vrf_label_t vrf_label(mpls_label_t(16), "foo");
* mgr->mpls_vrf_label_set(vrf_label);
* 

By configuring a static VRF label route, the switch will decapsulate traffic matching the specified top label and forward normally based on the inner protocol headers and the routes within the specified VRF. IPv4, IPv6, and MPLS are the only inner protocols presently supported. Static MPLS routes are only available within the ‘default’ VRF when the inner protocol is MPLS, the specified VRF is ignored.

namespace eos
class mpls_vrf_label_iter_t
#include <mpls_vrf_label.h>

An iterator that yields a mpls_vrf_label_t for each configured VRF label route.

Private Functions

mpls_vrf_label_iter_t(mpls_vrf_label_iter_impl * const)

Friends

friend class mpls_vrf_label_iter_impl
class mpls_vrf_label_mgr
#include <mpls_vrf_label.h>

A manager of ‘mpls static vrf-label’ configurations.

Create one of these via sdk object prior to starting the agent main loop. When your eos::agent_handler::on_initialized virtual function is called, the manager is valid for use.

Public Functions

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

Enter resync mode.

At this point the mpls_vrf_label_mgr will start tracking which routes you’ve added.

virtual void resync_complete() = 0

Exit resync mode.

All VRF label routes in Sysdb that you haven’t re-added during this resync period will now be deleted.

virtual mpls_vrf_label_iter_t mpls_vrf_label_iter() const = 0

Iterates over all the VRF label routes currently configured.

virtual mpls_vrf_label_t mpls_vrf_label(mpls_label_t const &) const = 0

Returns the current configuration of a VRF label route

If no VRF label route exists, this returns an empty mpls_vrf_label_t()

virtual void mpls_vrf_label_set(mpls_vrf_label_t const &) = 0

Adds the specified VRF label route to the system configuration.

Either creates or updates a VRF label route (keyed by the label).

virtual void mpls_vrf_label_del(mpls_label_t const &) = 0

Removes the VRF label route from the configuration.

If the specified label does not exist, no action is taken.

Protected Functions

mpls_vrf_label_mgr()

Private Members

mpls_vrf_label_mgr

Type definitions in mpls_vrf_label

namespace eos
class mpls_vrf_label_t
#include <mpls_vrf_label.h>

A static VRF label decap route configuration model.

Public Functions

mpls_vrf_label_t()
mpls_vrf_label_t(mpls_label_t label, std::string vrf_name)
mpls_label_t label() const

Getter for ‘label’: the decap label.

std::string vrf_name() const

Getter for ‘vrf_name’: the name of the VRF.

bool operator==(mpls_vrf_label_t const & other) const
bool operator!=(mpls_vrf_label_t const & other) const
bool operator<(mpls_vrf_label_t const & other) const
uint32_t hash() const

The hash function for type mpls_vrf_label_t.

std::string to_string() const

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

Private Members

mpls_label_t label_
std::string vrf_name_

Friends

friend std::ostream & operator<<

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

Table Of Contents

Previous topic

mpls_route

Next topic

neighbor_table