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);
65 <<
" ip:" << m_ip_addr.to_string() <<
" epg-id:" << m_epg_id;
82 return ((m_itf == other.m_itf) && (m_ip_addr == other.m_ip_addr));
88 msg_t req(con.
ctx(), std::ref(*
this));
90 auto& payload = req.get_request().get_payload();
92 payload.endpoint.sw_if_index = m_itf.
value();
93 payload.endpoint.epg_id = ~0;
94 to_bytes(m_ip_addr, &payload.endpoint.is_ip6, payload.endpoint.address);
104 std::ostringstream s;
106 <<
" ip:" << m_ip_addr.to_string();
124 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
136 return (
"gbp-endpoint-dump");
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
rc_t wait()
Wait on the commands promise.
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.
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.
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.
HW::item< bool > & m_hw_item
A reference to an object's HW::item that the command will update.
HW::item< bool > & item()
return the HW item the command updates
vapi::Gbp_endpoint_add_del msg_t
convenient typedef