21 namespace vxlan_tunnel_cmds {
24 const std::string& name,
34 return (m_ep == other.m_ep);
40 msg_t req(con.
ctx(), std::ref(*
this));
42 auto& payload = req.get_request().get_payload();
45 to_bytes(m_ep.
src, &payload.is_ipv6, payload.src_address);
46 to_bytes(m_ep.
dst, &payload.is_ipv6, payload.dst_address);
47 payload.mcast_sw_if_index = ~0;
48 payload.encap_vrf_id = 0;
49 payload.decap_next_index = ~0;
50 payload.vni = m_ep.
vni;
82 return (m_ep == other.m_ep);
88 msg_t req(con.
ctx(), std::ref(*
this));
90 auto payload = req.get_request().get_payload();
93 to_bytes(m_ep.
src, &payload.is_ipv6, payload.src_address);
94 to_bytes(m_ep.
dst, &payload.is_ipv6, payload.dst_address);
95 payload.mcast_sw_if_index = ~0;
96 payload.encap_vrf_id = 0;
97 payload.decap_next_index = ~0;
98 payload.vni = m_ep.
vni;
112 std::ostringstream s;
131 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
133 auto& payload = m_dump->get_request().get_payload();
134 payload.sw_if_index = ~0;
146 return (
"Vpp-vxlan_tunnels-Dump");
std::string to_string() const
Debug print function.
static const rc_t NOOP
The HW write/update action was/has not been attempted.
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
HW::item< handle_t > & m_hw_item
A reference to an object's HW::item that the command will update.
bool operator==(const create_cmd &i) const
Comparison operator - only used for UT.
rc_t issue(connection &con)
Issue the command to VPP/HW.
rc_t issue(connection &con)
Issue the command to VPP/HW.
Combaintion of attributes that are a unique key for a VXLAN tunnel.
void remove_interface()
add the created interface to the DB
boost::asio::ip::address dst
The destination IP address of the endpoint.
Error codes that VPP will return during a HW write.
A Command class that creates an VXLAN tunnel.
std::string to_string() const
convert to string format for debug purposes
void to_bytes(const boost::asio::ip::address_v6 &addr, uint8_t *array)
A representation of the connection to VPP.
rc_t issue(connection &con)
Issue the command to VPP/HW.
A functor class that creates an VXLAN tunnel.
A cmd class that Dumps all the Vpp interfaces.
HW::item< handle_t > & item()
return the HW item the command updates
#define VAPI_CALL(_stmt)
Convenince wrapper macro for error handling in VAPI sends.
std::string to_string() const
convert to string format for debug purposes
A representation of an interface in VPP.
DEFINE_VAPI_MSG_IDS_VXLAN_API_JSON
std::string to_string() const
convert to string format for debug purposes
static const rc_t OK
The HW write was successfull.
dump_cmd()
Default Constructor.
vapi::Connection & ctx()
Retrun the VAPI context the commands will use.
create_cmd(HW::item< handle_t > &item, const std::string &name, const vxlan_tunnel::endpoint_t &ep)
Create command constructor taking HW item to update and the endpoint values.
void insert_interface()
add the created interface to the DB
The VPP Object Model (VOM) library.
void set(const rc_t &rc)
Set the HW return code - should only be called from the family of Command objects.
vapi::Vxlan_add_del_tunnel msg_t
convenient typedef
uint32_t vni
The VNI of the endpoint.
bool operator==(const delete_cmd &i) const
Comparison operator - only used for UT.
std::string to_string() const
convert to string format for debug purposes
boost::asio::ip::address src
The src IP address of the endpoint.
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
HW::item< handle_t > wait()
Wait on the commands promise.