32 vxlan_tunnel::mode_t::mode_t(
int v,
const std::string s)
65 <<
"src:" <<
src.to_string() <<
" dst:" <<
dst.to_string() <<
" vni:" <<
vni 79 s << VXLAN_TUNNEL_NAME <<
"-" << mode.
to_string() <<
"-" << src <<
"-" << dst
92 , m_tep(src, dst, vni)
103 :
interface(mk_name(src, dst, mode, vni),
106 , m_tep(src, dst, vni)
125 std::shared_ptr<vxlan_tunnel>
132 vxlan_tunnel::sweep()
144 vxlan_tunnel::replay()
167 std::ostringstream s;
192 std::shared_ptr<vxlan_tunnel>
195 return std::dynamic_pointer_cast<
vxlan_tunnel>(singular_i());
198 std::shared_ptr<interface>
199 vxlan_tunnel::singular_i()
const 201 return m_db.find_or_add(
key(), *
this);
211 std::shared_ptr<vxlan_tunnel_cmds::dump_cmd>
cmd =
212 std::make_shared<vxlan_tunnel_cmds::dump_cmd>();
217 for (
auto& record : *cmd) {
218 auto& payload = record.get_payload();
221 from_bytes(payload.is_ipv6, payload.src_address);
223 from_bytes(payload.is_ipv6, payload.dst_address);
225 std::shared_ptr<vxlan_tunnel> vt =
235 std::shared_ptr<vxlan_gbp_tunnel_cmds::dump_cmd>
cmd =
236 std::make_shared<vxlan_gbp_tunnel_cmds::dump_cmd>();
241 for (
auto& record : *cmd) {
242 auto& payload = record.get_payload();
243 handle_t hdl(payload.tunnel.sw_if_index);
247 std::shared_ptr<vxlan_tunnel> vt =
265 vxlan_tunnel::event_handler::handle_replay()
271 vxlan_tunnel::event_handler::order()
const A Command class that creates an VXLAN tunnel.
std::string to_string() const
Debug print function.
A representation of a VXLAN Tunnel in VPP.
void release()
release/remove an interface form the singular store
const std::string VXLAN_TUNNEL_NAME
static std::shared_ptr< vxlan_tunnel > find(const interface::key_t &k)
Fond the singular instance of the interface in the DB by key.
A template base class for all enum types.
virtual std::string to_string() const
Debug rpint function.
Combaintion of attributes that are a unique key for a VXLAN tunnel.
const std::string key_t
In the opflex world each entity is known by a URI which can be converted into a string.
virtual interfaces - those that depend on some real interface
HW::item< handle_t > m_hdl
The SW interface handle VPP has asigned to the interface.
static void register_handler(const std::vector< std::string > &cmds, const std::string &help, command_handler *ch)
Register a command handler for inspection.
boost::asio::ip::address dst
The destination IP address of the endpoint.
static rc_t write()
Write/Execute all commands hitherto enqueued.
static const log_level_t DEBUG
ip_address_t from_api(const vapi_type_address &v)
static const handle_t INVALID
A value of an interface handle_t that means the itf does not exist.
A Command class that creates an VXLAN tunnel.
std::string to_string() const
convert to string format for debug purposes
T & data()
Return the data read/written.
static singular_db< key_t, interface > m_db
A map of all interfaces key against the interface's name.
A functor class that creates an VXLAN tunnel.
std::shared_ptr< vxlan_tunnel > singular() const
Return the matching 'singular instance'.
The admin state of the interface.
A representation of an interface in VPP.
A type declaration of an interface handle in VPP.
endpoint_t()
Default constructor.
static rc_t commit(const client_db::key_t &key, const OBJ &obj)
Make the State in VPP reflect the expressed desired state.
void event_handler(void *tls_async)
dependency_t
There needs to be a strict order in which object types are read from VPP (at boot time) and replayed ...
const std::string & name() const
Return the interface type.
static void enqueue(cmd *f)
Enqueue A command for execution.
boost::asio::ip::address from_bytes(uint8_t is_ip6, const uint8_t *bytes)
Convert a VPP byte stinrg into a boost addresss.
static const mode_t STANDARD
The VPP Object Model (VOM) library.
A representation of a method call to VPP.
A functor class that creates an VXLAN tunnel.
bool operator==(const endpoint_t &o) const
Comparison operator.
uint32_t vni
The VNI of the endpoint.
vl_api_gbp_vxlan_tunnel_mode_t mode
const std::string & to_string() const
convert to string format for debug purposes
std::string key_t
The key for interface's key.
vxlan_tunnel(const boost::asio::ip::address &src, const boost::asio::ip::address &dst, uint32_t vni, const mode_t &mode=mode_t::STANDARD)
Construct a new object matching the desried state.
boost::asio::ip::address src
The src IP address of the endpoint.
static bool register_listener(listener *listener)
Register a listener of events.
const key_t & key() const
Return the interface type.
const handle_t & handle() const
Return VPP's handle to this object.