21 namespace gbp_endpoint_cmds {
39 return ((m_itf == other.m_itf) && (m_ip_addr == other.m_ip_addr) &&
40 (m_mac == other.m_mac) && (m_epg_id == other.m_epg_id));
46 msg_t req(con.
ctx(), std::ref(*
this));
48 auto& payload = req.get_request().get_payload();
50 payload.endpoint.sw_if_index = m_itf.
value();
51 payload.endpoint.epg_id = m_epg_id;
52 to_bytes(m_ip_addr, &payload.endpoint.is_ip6, payload.endpoint.address);
53 m_mac.
to_bytes(payload.endpoint.mac, 6);
67 <<
" ip:" << m_ip_addr.to_string() <<
" epg-id:" << m_epg_id;
84 return ((m_itf == other.m_itf) && (m_ip_addr == other.m_ip_addr));
90 msg_t req(con.
ctx(), std::ref(*
this));
92 auto& payload = req.get_request().get_payload();
94 payload.endpoint.sw_if_index = m_itf.
value();
95 payload.endpoint.epg_id = ~0;
96 to_bytes(m_ip_addr, &payload.endpoint.is_ip6, payload.endpoint.address);
108 std::ostringstream s;
110 <<
" ip:" << m_ip_addr.to_string();
128 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
140 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
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.
create_cmd(HW::item< bool > &item, const handle_t &itf, const boost::asio::ip::address &ip_addr, const mac_address_t &mac, epg_id_t epg_id)
Constructor.
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.
void to_bytes(uint8_t *array, uint8_t len) const
Convert to byte array.
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.
Type def of a Ethernet address.
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.