|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
22 namespace gbp_endpoint_cmds {
24 static vapi_enum_gbp_endpoint_flags
43 const std::vector<boost::asio::ip::address>& ip_addrs,
49 , m_ip_addrs(ip_addrs)
59 return ((m_itf == other.m_itf) && (m_ip_addrs == other.m_ip_addrs) &&
60 (m_mac == other.m_mac) && (m_sclass == other.m_sclass) &&
61 (m_flags == other.m_flags));
67 msg_t req(
con.ctx(), m_ip_addrs.size() *
sizeof(vapi_type_address),
71 auto& payload = req.get_request().get_payload();
72 payload.endpoint.sw_if_index = m_itf.
value();
73 payload.endpoint.sclass = m_sclass;
74 payload.endpoint.n_ips = m_ip_addrs.size();
75 payload.endpoint.flags =
to_api(m_flags);
77 for (n = 0; n < payload.endpoint.n_ips; n++) {
78 VOM::to_api(m_ip_addrs[n], payload.endpoint.ips[n]);
80 to_api(m_mac, payload.endpoint.mac);
90 int handle = reply.get_response().get_payload().handle;
91 int retval = reply.get_response().get_payload().retval;
110 std::ostringstream s;
113 for (
auto ip : m_ip_addrs)
116 s <<
"] mac:" << m_mac <<
" slcass:" << m_sclass
136 msg_t req(
con.ctx(), std::ref(*
this));
138 auto& payload = req.get_request().get_payload();
149 std::ostringstream s;
180 return (
"gbp-endpoint-dump");
@ GBP_API_ENDPOINT_FLAG_LEARNT
const static flags_t EXTERNAL
vapi::Gbp_endpoint_dump msg_t
delete_cmd(HW::item< handle_t > &item)
Constructor.
rc_t wait()
Wait on the commands promise.
DEFINE_VAPI_MSG_IDS_GBP_API_JSON
The VPP Object Model (VOM) library.
rc_t issue(connection &con)
Issue the command to VPP/HW.
const static rc_t OK
The HW write was successfull.
static const rc_t & from_vpp_retval(int32_t rv)
Get the rc_t from the VPP API value.
A command class that creates or updates the GBP endpoint.
rc_t issue(connection &con)
Issue the command to VPP/HW.
uint32_t value() const
get the value of the handle
A base class for all RPC commands to VPP.
@ GBP_API_ENDPOINT_FLAG_BOUNCE
@ GBP_API_ENDPOINT_FLAG_REMOTE
HW::item< handle_t > & m_hw_item
A reference to an object's HW::item that the command will update.
std::unique_ptr< vapi::Gbp_endpoint_dump > m_dump
The VAPI event registration.
A cmd class that deletes a GBP endpoint.
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
const static flags_t BOUNCE
create_cmd(HW::item< handle_t > &item, const handle_t &itf, const std::vector< boost::asio::ip::address > &ip_addrs, const mac_address_t &mac, sclass_t sclass, const gbp_endpoint::flags_t &flags)
Constructor.
bool operator==(const delete_cmd &i) const
Comparison operator - only used for UT.
#define VAPI_CALL(_stmt)
Convenince wrapper macro for error handling in VAPI sends.
rc_t issue(connection &con)
Issue the command to VPP/HW.
const static flags_t LEARNT
@ GBP_API_ENDPOINT_FLAG_NONE
A representation of the connection to VPP.
@ GBP_API_ENDPOINT_FLAG_EXTERNAL
rc_t wait()
Wait for the issue of the command to complete.
A type declaration of an interface handle in VPP.
A cmd class that Dumps all the GBP endpoints.
static vapi_enum_gbp_endpoint_flags to_api(const gbp_endpoint::flags_t &in)
std::string to_string() const
convert to string format for debug purposes
const static log_level_t DEBUG
const static flags_t REMOTE
vapi_enum_ip_neighbor_flags to_api(const neighbour::flags_t &f)
vapi::Gbp_endpoint_add msg_t
convenient typedef
const std::string & to_string() const
convert to string format for debug purposes
T & data()
Return the data read/written.
bool operator==(const create_cmd &i) const
Comparison operator - only used for UT.
virtual vapi_error_e operator()(vapi::Gbp_endpoint_add &reply)
call operator used as a callback by VAPI when the reply is available
Type def of a Ethernet address.
std::string to_string() const
convert to string format for debug purposes
const static handle_t INVALID
A value of an interface handle_t that means the itf does not exist.
std::string to_string() const
convert to string format for debug purposes
Error codes that VPP will return during a HW write.
std::string to_string() const
convert to string format for debug purposes
void fulfill(const HW::item< handle_t > &d)
Fulfill the commands promise.
vl_api_wireguard_peer_flags_t flags