mpls

MPLS related type definitions.

namespace eos

Variables

mpls_label_t const mpls_label_explicit_null_v4 = mpls_label_t(0)

MPLS reserved label definitions (0..15). See http://www.iana.org/assignments/mpls-label-values/mpls-label-values.xhtml

mpls_label_t const mpls_label_router_alert = mpls_label_t(1)
mpls_label_t const mpls_label_explicit_null_v6 = mpls_label_t(2)
mpls_label_t const mpls_label_implicit_null = mpls_label_t(3)
mpls_label_t const mpls_label_entropy_indicator = mpls_label_t(7)
mpls_label_t const mpls_label_gal = mpls_label_t(13)
mpls_label_t const mpls_label_oam_alert = mpls_label_t(14)

Type definitions in mpls

namespace eos

Enums

enum mpls_action_t

The action to take for an MPLS route.

Values:

MPLS_ACTION_NULL
MPLS_ACTION_PUSH
MPLS_ACTION_POP
MPLS_ACTION_SWAP
MPLS_ACTION_FORWARD
enum mpls_ttl_mode_t

Whether to use the pipe or uniform TTL inheritance mode.

Values:

MPLS_TTLMODE_NULL
MPLS_TTLMODE_PIPE

pipe” mode, do not inherit TTL from inner IP.

MPLS_TTLMODE_UNIFORM

uniform” mode, inherit TTL from inner IP.

enum mpls_payload_type_t

The inner payload type. Used in a similar way to ethertype, as MPLS does not provide this in the packet.

Values:

MPLS_PAYLOAD_TYPE_NULL
MPLS_PAYLOAD_TYPE_MPLS
MPLS_PAYLOAD_TYPE_IPV4
MPLS_PAYLOAD_TYPE_IPV6
MPLS_PAYLOAD_TYPE_GUESS
class mpls_label_t
#include <mpls.h>

An MPLS label, per RFC 3032. Note: label id 0 (default value) is the explicit null label. LSRs receiving this label are expected to pop it and perform ultimate IP orwarding. MPLS label numbers are 20 bits in size, covering the range 0..1048575.

Public Types

enum [anonymous]

Values:

MIN
MAX = 0xfffff

INVALID = 0x100000

Public Functions

mpls_label_t(uint32_t label)
mpls_label_t()
uint32_t label() const

Getter for ‘label’: key for the route that this via is attached to.

void label_is(uint32_t label)

Setter for ‘label’.

bool operator!() const
std::string to_string() const

Returns a string representation of the MPLS label.

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

The hash function for type mpls_label_t.

void mix_me(hash_mix &h) const

The hash mix function for type mpls_label_t.

Private Members

uint32_t label_

Friends

friend eos::MplsLabelHelper
std::ostream &operator<<(std::ostream &os, const mpls_label_t &obj)

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