22 namespace vxlan_gbp_tunnel_cmds {
25 const std::string&
name,
32 , m_mcast_itf(mcast_itf)
39 return (m_ep == other.m_ep);
45 msg_t req(con.
ctx(), std::ref(*
this));
47 auto& payload = req.get_request().get_payload();
53 payload.tunnel.mcast_sw_if_index = m_mcast_itf.
value();
54 payload.tunnel.encap_table_id = 0;
55 payload.tunnel.vni = m_ep.
vni;
56 payload.tunnel.instance = ~0;
91 return (m_ep == other.m_ep);
97 msg_t req(con.
ctx(), std::ref(*
this));
99 auto payload = req.get_request().get_payload();
105 payload.tunnel.mcast_sw_if_index = ~0;
106 payload.tunnel.encap_table_id = 0;
107 payload.tunnel.vni = m_ep.
vni;
121 std::ostringstream s;
140 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
142 auto& payload = m_dump->get_request().get_payload();
143 payload.sw_if_index = ~0;
155 return (
"vxlan-gbp-tunnel-dump");
A Command class that creates an VXLAN tunnel.
rc_t issue(connection &con)
Issue the command to VPP/HW.
std::string to_string() const
Debug print function.
static const rc_t NOOP
The HW write/update action was/has not been attempted.
std::string to_string() const
convert to string format for debug purposes
Combaintion of attributes that are a unique key for a VXLAN tunnel.
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
void remove_interface()
remove the deleted interface from the DB
uint32_t value() const
get the value of the handle
boost::asio::ip::address dst
The destination IP address of the endpoint.
rc_t issue(connection &con)
Issue the command to VPP/HW.
Error codes that VPP will return during a HW write.
vapi_enum_ip_neighbor_flags to_api(const neighbour::flags_t &f)
std::string to_string() const
convert to string format for debug purposes
std::string to_string() const
convert to string format for debug purposes
rc_t wait()
Wait on the commands promise.
rc_t rc() const
Get the HW return code.
A representation of the connection to VPP.
#define VAPI_CALL(_stmt)
Convenince wrapper macro for error handling in VAPI sends.
DEFINE_VAPI_MSG_IDS_VXLAN_GBP_API_JSON
create_cmd(HW::item< handle_t > &item, const std::string &name, const vxlan_tunnel::endpoint_t &ep, bool is_l2, handle_t mcast_itf)
Create command constructor taking HW item to update and the endpoint values.
A representation of an interface in VPP.
rc_t issue(connection &con)
Issue the command to VPP/HW.
A type declaration of an interface handle in VPP.
bool operator==(const delete_cmd &i) const
Comparison operator - only used for UT.
static const rc_t OK
The HW write was successfull.
delete_cmd(HW::item< handle_t > &item, const vxlan_tunnel::endpoint_t &ep)
delete command constructor taking HW item to update and the endpoint values
vapi::Connection & ctx()
Retrun the VAPI context the commands will use.
dump_cmd()
Default Constructor.
void insert_interface()
add the created interface to the DB
The VPP Object Model (VOM) library.
A functor class that creates an VXLAN tunnel.
A cmd class that Dumps all the Vpp interfaces.
void set(const rc_t &rc)
Set the HW return code - should only be called from the family of Command objects.
std::string to_string() const
convert to string format for debug purposes
uint32_t vni
The VNI of the endpoint.
bool operator==(const create_cmd &i) const
Comparison operator - only used for UT.
boost::asio::ip::address src
The src IP address of the endpoint.
HW::item< handle_t > & m_hw_item
A reference to an object's HW::item that the command will update.
HW::item< handle_t > & item()
return the HW item the command updates
vapi::Vxlan_gbp_tunnel_add_del msg_t
convenient typedef