route_map

Route Map management module.

Route map is a ordered set of route map entry statement that manage the redistribution of IP routes into the protocol domain and modify the attrbutes of routes.

This module provides APIs to query Route Map information.

namespace eos
class route_map_mgr
#include <route_map.h>

A manager of route map configurations.

A example of the API usage is in example/RouteMapAgent.cpp

Public Functions

virtual ~route_map_mgr()
virtual uint8_t priority() const = 0

Returns the priority value of eossdk route map configuration.

virtual void priority_is(uint8_t) = 0

Configures the priority value of eossdk route map configuration.

virtual route_map_t route_map(route_map_name_t const&) const = 0

Returns a eossdk route map with corresponding route map name, which contains route map entries. Returns an empty route_map_t if no matching route map was found.

virtual route_map_entry_t route_map_entry(route_map_name_t const&, route_map_sequence_number_t) const = 0

Returns a route map entry with the corresponding sequence number in corresponding route map. Returns an empty route_map_entry_t if no matching route map entry was found.

virtual void route_map_set(route_map_name_t const&, route_map_t const&) = 0

Creates or updates a route map.

virtual void route_map_entry_set(route_map_name_t const&, route_map_sequence_number_t, route_map_entry_t const&) = 0

Creates or updates a route map entry in corresponding route map.

virtual void route_map_del(route_map_name_t const&) = 0

Removes the corresponding route map from the configuration if exists.

virtual void route_map_entry_del(route_map_name_t const&, route_map_sequence_number_t) = 0

Removes the corresponding route map entry from a given route map.

Protected Functions

route_map_mgr()

Private Members

route_map_mgr

Type definitions in route_map

namespace eos

Typedefs

typedef std::string route_map_name_t
typedef uint32_t route_map_sequence_number_t

Enums

enum bandwidth_unit_t

Values:

enum route_map_operation_type_t

Route map extended community link bandwidth operation type.

Values:

enumerator OPERATION_TYPE_NONE
enumerator OPERATION_TYPE_SET
enumerator OPERATION_TYPE_DELETE
#include <route_map.h>

Extended community link bandwidth value.

Public Functions

Getter for ‘value’: The link bandwidth value.

Setter for ‘value’.

Getter for ‘unit’: The link bandwidth bitrate unit.

Setter for ‘unit’.

The hash function for type link_bandwidth_t.

The hash mix function for type link_bandwidth_t.

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

Public Static Functions

Private Members

Friends

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

#include <route_map.h>

Route map link bandwidth operation attribute information.

Public Functions

Create route map link bandwidth.

Getter for ‘operation’: Operation type.

Getter for ‘asn’: Peer AS number.

Getter for ‘bandwidth’: Link bandwidth value.

The hash function for type route_map_link_bandwidth_t.

The hash mix function for type route_map_link_bandwidth_t.

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

Public Static Functions

Private Members

Friends

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

class route_map_entry_t
#include <route_map.h>

Route map entry sequence.

Public Functions

route_map_entry_t()
explicit route_map_entry_t(bool permit)
route_map_entry_t(const route_map_entry_t &other)
route_map_entry_t &operator=(route_map_entry_t const &other)
route_map_entry_t(route_map_entry_t &&other) noexcept
route_map_entry_t &operator=(route_map_entry_t &&other) noexcept
bool permit() const

Getter for ‘permit’: Permit sequence entry when true, deny otherwise.

void permit_is(bool permit)

Setter for ‘permit’.

route_map_sequence_number_t continue_sequence() const

Getter for ‘continue_sequence’: Continue to a different map entry. Set to 0 for deletion.

void continue_sequence_is(route_map_sequence_number_t continue_sequence)

Setter for ‘continue_sequence’.

route_map_link_bandwidth_t link_bandwidth() const

Getter for ‘link_bandwidth’: BGP extended community link bandwidth attribute.

void link_bandwidth_is(route_map_link_bandwidth_t const &link_bandwidth)

Setter for ‘link_bandwidth’.

void link_bandwidth_is(route_map_link_bandwidth_t &&link_bandwidth)

Moving Setter for ‘link_bandwidth’.

void link_bandwidth_del()

Remove the link bandwidth configuration.

bool operator==(route_map_entry_t const &other) const
bool operator!=(route_map_entry_t const &other) const
uint32_t hash() const

The hash function for type route_map_entry_t.

void mix_me(hash_mix &h) const

The hash mix function for type route_map_entry_t.

std::string to_string() const

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

Public Static Functions

static inline void *operator new(std::size_t, void *ptr)
static void *operator new(std::size_t)
static void operator delete(void*) noexcept

Private Members

std::shared_ptr<route_map_entry_impl_t> pimpl

Friends

friend std::ostream &operator<<(std::ostream &os, const route_map_entry_t &obj)

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

class route_map_t

Public Functions

route_map_t()
route_map_t(const route_map_t &other)
route_map_t &operator=(route_map_t const &other)
route_map_t(route_map_t &&other) noexcept
route_map_t &operator=(route_map_t &&other) noexcept
std::map<route_map_sequence_number_t, route_map_entry_t> const &map_entry() const

Getter for ‘map_entry’: A map of route map entries, keyed by sequence number.

void map_entry_is(std::map<route_map_sequence_number_t, route_map_entry_t> const &map_entry)

Setter for ‘map_entry’.

void map_entry_is(std::map<route_map_sequence_number_t, route_map_entry_t> &&map_entry)

Moving Setter for ‘map_entry’.

void map_entry_set(route_map_sequence_number_t const &key, route_map_entry_t const &value)

Inserts key/value pair to the map.

void map_entry_set(route_map_sequence_number_t const &key, route_map_entry_t &&value)

Inserts key/value pair to the map.

void map_entry_del(route_map_sequence_number_t const &key)

Deletes the key/value pair from the map.

void map_entry_set(route_map_sequence_number_t &&key, route_map_entry_t const &value)

Inserts key/value pair to the map.

void map_entry_set(route_map_sequence_number_t &&key, route_map_entry_t &&value)

Inserts key/value pair to the map.

bool operator==(route_map_t const &other) const
bool operator!=(route_map_t const &other) const
uint32_t hash() const

The hash function for type route_map_t.

void mix_me(hash_mix &h) const

The hash mix function for type route_map_t.

std::string to_string() const

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

Public Static Functions

static inline void *operator new(std::size_t, void *ptr)
static void *operator new(std::size_t)
static void operator delete(void*) noexcept

Private Members

std::shared_ptr<route_map_impl_t> pimpl

Friends

friend std::ostream &operator<<(std::ostream &os, const route_map_t &obj)

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