nexthop_group_tunnel

Nexthop Group tunnels are a tunneling abstraction in EOS.

A nexthop group tunnel is comprised of a tunnel endpoint (IP prefix) and a nexthop group name representing the underlying nexthop group that forwards the traffic.

The underlying nexthop group must be manually maintained by the agent. If the underlying nexthop group is not configured, the tunnel endpoint will be unreachable until the given nexthop group is configured.

The following example creates a nexthop group tunnel which has an underlying nexthop group “nhg1” that performs IP-in-IP encapsulation of traffic sent to it. For a usage of a nexthop group, see the nexthop_group.h file.

// Specify a tunnel endpoint and a nexthop group name
eos::nexthop_group_tunnel_t nhg_tunnel(eos::ip_prefix_t("10.0.0.1/32"), "nhg1");
nexthop_group_tunnel_mgr()->nexthop_group_tunnel_set(nhg_tunnel);
// Configure the underlying nexthop group
eos::nexthop_group_t nhg("nhg1", eos::NEXTHOP_GROUP_IP_IN_IP);
eos::nexthop_group_entry_t nhe1(eos::ip_addr_t("172.12.1.1"));
nhg.nexthop_set(0, nhe1);
nexthop_group_mgr()->nexthop_set(nhg1);

namespace eos
class nexthop_group_tunnel_handler
#include <nexthop_group_tunnel.h>

The nexthop group tunnel handler.

Public Functions

nexthop_group_tunnel_handler(nexthop_group_tunnel_mgr *)
nexthop_group_tunnel_mgr * get_nexthop_group_tunnel_mgr() const
class nexthop_group_tunnel_iter_t
#include <nexthop_group_tunnel.h>

An iterator over configured nexthop group tunnel.

Private Functions

nexthop_group_tunnel_iter_t(nexthop_group_tunnel_iter_impl * const)

Friends

friend class nexthop_group_tunnel_iter_impl
class nexthop_group_tunnel_mgr
#include <nexthop_group_tunnel.h>

The nexthop group tunnel manager.

Public Functions

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

Begin resync mode.

virtual void resync_complete() = 0

Complete resync mode, ready for regular updates.

virtual nexthop_group_tunnel_iter_t nexthop_group_tunnel_iter() const = 0

Returns an iterator over configured nexthop group tunnel.

virtual nexthop_group_tunnel_t nexthop_group_tunnel(ip_prefix_t const & tunnel_endpoint) const = 0

Retrieves an existing nexthop_group_tunnel_t by tunnel endpoint, if it exists. Otherwise this returns an empty nexthop_group_tunnel_t()

virtual bool exists(ip_prefix_t const & tunnel_endpoint) const = 0

Returns true if a nexthop group tunnel with the given tunnel endpoint has been configured.

virtual void nexthop_group_tunnel_set(nexthop_group_tunnel_t const &) = 0

Creates or updates a nexthop group tunnel.

virtual void nexthop_group_tunnel_del(ip_prefix_t const & tunnel_endpoint) = 0

Removes the nexthop group tunnel with the given tunnel endpoint if exists.

Protected Functions

nexthop_group_tunnel_mgr()

Private Members

nexthop_group_tunnel_mgr

Friends

friend class nexthop_group_tunnel_handler

Type definitions in nexthop_group_tunnel

namespace eos
class nexthop_group_tunnel_t
#include <nexthop_group_tunnel.h>

An IP nexthop group tunnel.

An IP nexthop group tunnel represents a tunnel over a nexthop-group.

Public Functions

nexthop_group_tunnel_t()

Default constructor.

nexthop_group_tunnel_t(ip_prefix_t const & tunnel_endpoint, std::string const & nhg_name)

Creates an ip nexthop group tunnel for a given tunnel endpoint prefix and nexthop-group.

nexthop_group_tunnel_t(const nexthop_group_tunnel_t & other)
nexthop_group_tunnel_t & operator=(nexthop_group_tunnel_t const & other)
ip_prefix_t tunnel_endpoint() const

Getter for ‘tunnel_endpoint’: IP v4/v6 prefix.

void tunnel_endpoint_is(ip_prefix_t const & tunnel_endpoint)

Setter for ‘tunnel_endpoint’.

std::string nhg_name() const

Getter for ‘nhg_name’: nexthop group name.

void nhg_name_is(std::string const & nhg_name)

Setter for ‘nhg_name’.

uint8_t igp_pref() const

Getter for ‘igp_pref’: the IGP preference of the tunnel endpoint.

void igp_pref_is(uint8_t igp_pref)

Setter for ‘igp_pref’.

uint32_t igp_metric() const

Getter for ‘igp_metric’: the IGP metric of the tunnel endpoint.

void igp_metric_is(uint32_t igp_metric)

Setter for ‘igp_metric’.

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

The hash function for type nexthop_group_tunnel_t.

void mix_me(hash_mix & h) const

The hash mix function for type nexthop_group_tunnel_t.

std::string to_string() const

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

Private Members

std::shared_ptr< nexthop_group_tunnel_impl_t > pimpl

Friends

friend std::ostream & operator<<

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