decap_group¶
Tunnel decapsulation group management.
This module manages tunnel decapsulation for traffic arriving at the switch (on any interface). This allows the switch to act as a tunnel endpoint.
By configuring a “decap group”, the switch will decapsulate traffic matching the specified outer (tunnel) header destination IP address and IP protocol. Presently only GRE traffic (protocol 47) is supported by decap groups. Traffic arriving at the switch matching the group’s parameters will be decapsulated and forwarded normally based on the inner protocol headers.
In this example, a decap group named “gre_tunnel1” is configured for GRE traffic arriving at the switch with a tunnel destination address of 172.12.0.1. That address may either be bound to a local switch interface or announced by the switch in routing protocols.
// Configures a decapsulation group to unwrap received GRE traffic
eos::decap_group_t tunnel("gre_tunnel1",
eos::ip_addr_t("172.12.0.1"),
eos::PROTOCOL_TYPE_GRE);
mgr->decap_group_set(tunnel);
-
namespace
eos
-
class
decap_group_iter_t
: public eos::iter_base<decap_group_t, decap_group_iter_impl>¶ - #include <decap_group.h>
An iterator that yields a
decap_group_t
for each configured decap group.Private Functions
-
explicit
decap_group_iter_t
(decap_group_iter_impl*const)¶
Friends
- friend class decap_group_iter_impl
-
explicit
-
class
decap_group_mgr
¶ - #include <decap_group.h>
A manager of ‘ip decap-group’ 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
~decap_group_mgr
()¶
-
virtual void
resync_init
() = 0¶ Enter resync mode.
At this point the decap_group_mgr will start tracking which groups you’ve added.
-
virtual void
resync_complete
() = 0¶ Exit resync mode.
All decap groups in Sysdb that you haven’t re-added during this resync period will now be deleted.
-
virtual decap_group_iter_t
decap_group_iter
() const = 0¶ Iterates over all the decap groups currently configured.
-
virtual decap_group_t
decap_group
(std::string const &decap_group_name) const = 0¶ Returns the current configuration of a decap group
If no decap group exists, this returns an empty
decap_group_t()
-
virtual void
decap_group_set
(decap_group_t const&) = 0¶ Adds the specified decap group to the system configuration.
Either creates or updates a decap group (keyed by the group name).
Protected Functions
-
decap_group_mgr
()¶
Private Members
-
decap_group_mgr
-
virtual
-
class
Type definitions in decap_group¶
-
namespace
eos
Enums
-
class
decap_group_t
¶ - #include <decap_group.h>
An IP decap group configuration model. At this time, all decap groups are configured in the default VRF.
Public Functions
-
decap_group_t
()¶
-
decap_group_t
(std::string const &group_name, ip_addr_t const &destination_addr, decap_protocol_type_t protocol_type)¶
-
decap_group_t
(const decap_group_t &other)¶
-
decap_group_t &
operator=
(decap_group_t const &other)¶
-
decap_group_t
(decap_group_t &&other) noexcept¶
-
decap_group_t &
operator=
(decap_group_t &&other) noexcept¶
-
std::string
group_name
() const¶ Getter for ‘group_name’: the decap group name. Used to uniquely identify this group.
-
ip_addr_t
destination_addr
() const¶ Getter for ‘destination_addr’: match this destination IP on the outermost IP header.
-
decap_protocol_type_t
protocol_type
() const¶ Getter for ‘protocol_type’: decapsulate only packets matching this outer IP protocol type.
-
void
protocol_type_is
(decap_protocol_type_t protocol_type)¶ Setter for ‘protocol_type’.
-
bool
operator==
(decap_group_t const &other) const¶
-
bool
operator!=
(decap_group_t const &other) const¶
-
bool
operator<
(decap_group_t const &other) const¶
-
uint32_t
hash
() const¶ The hash function for type decap_group_t.
-
void
mix_me
(hash_mix &h) const¶ The hash mix function for type decap_group_t.
Public Static Functions
-
static void
operator delete
(void*) noexcept¶
Friends
-
friend std::ostream &
operator<<
(std::ostream &os, const decap_group_t &obj)¶ A utility stream operator that adds a string representation of decap_group_t to the ostream.
-
-
class