21 namespace gbp_endpoint_cmds {
25 const boost::asio::ip::address& ip_addr,
37 return ((m_itf == other.m_itf) && (m_ip_addr == other.m_ip_addr) &&
38 (m_epg_id == other.m_epg_id));
44 msg_t req(con.
ctx(), std::ref(*
this));
46 auto& payload = req.get_request().get_payload();
48 payload.endpoint.sw_if_index = m_itf.
value();
49 payload.endpoint.epg_id = m_epg_id;
50 to_bytes(m_ip_addr, &payload.endpoint.is_ip6, payload.endpoint.address);
64 <<
" ip:" << m_ip_addr.to_string() <<
" epg-id:" << m_epg_id;
71 const boost::asio::ip::address& ip_addr)
81 return ((m_itf == other.m_itf) && (m_ip_addr == other.m_ip_addr));
87 msg_t req(con.
ctx(), std::ref(*
this));
89 auto& payload = req.get_request().get_payload();
91 payload.endpoint.sw_if_index = m_itf.
value();
92 payload.endpoint.epg_id = ~0;
93 to_bytes(m_ip_addr, &payload.endpoint.is_ip6, payload.endpoint.address);
105 std::ostringstream s;
107 <<
" ip:" << m_ip_addr.to_string();
125 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
137 return (
"gbp-endpoint-dump");
HW::item< bool > & m_hw_item
A reference to an object's HW::item that the command will update.
uint32_t value() const
get the value of the handle
uint32_t epg_id_t
EPG IDs are 32 bit integers.
Error codes that VPP will return during a HW write.
rc_t issue(connection &con)
Issue the command to VPP/HW.
A cmd class that deletes a GBP endpoint.
std::string to_string() const
convert to string format for debug purposes
create_cmd(HW::item< bool > &item, const handle_t &itf, const boost::asio::ip::address &ip_addr, epg_id_t epg_id)
Constructor.
void to_bytes(const boost::asio::ip::address_v6 &addr, uint8_t *array)
A representation of the connection to VPP.
A cmd class that Dumps all the GBP endpoints.
delete_cmd(HW::item< bool > &item, const handle_t &itf, const boost::asio::ip::address &ip_addr)
Constructor.
A command class that creates or updates the GBP endpoint.
HW::item< bool > & item()
return the HW item the command updates
A base class for all RPC commands to VPP.
#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
std::string to_string() const
convert to string format for debug purposes
DEFINE_VAPI_MSG_IDS_GBP_API_JSON
A type declaration of an interface handle in VPP.
static const rc_t OK
The HW write was successfull.
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
rc_t issue(connection &con)
Issue the command to VPP/HW.
vapi::Connection & ctx()
Retrun the VAPI context the commands will use.
std::string to_string() const
convert to string format for debug purposes
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::Gbp_endpoint_add_del msg_t
convenient typedef
bool operator==(const create_cmd &i) const
Comparison operator - only used for UT.
rc_t issue(connection &con)
Issue the command to VPP/HW.
bool operator==(const delete_cmd &i) const
Comparison operator - only used for UT.
rc_t wait()
Wait on the commands promise.