21 namespace interface_span_cmds {
28 , m_itf_from(itf_from)
37 return ((m_itf_from == o.m_itf_from) && (m_itf_to == o.m_itf_to) &&
38 (m_state == o.m_state));
44 msg_t req(con.
ctx(), std::ref(*
this));
46 auto& payload = req.get_request().get_payload();
48 payload.sw_if_index_from = m_itf_from.
value();
49 payload.sw_if_index_to = m_itf_to.
value();
50 payload.state = m_state.
value();
72 , m_itf_from(itf_from)
80 return ((m_itf_from == o.m_itf_from) && (m_itf_to == o.m_itf_to));
86 msg_t req(con.
ctx(), std::ref(*
this));
88 auto& payload = req.get_request().get_payload();
90 payload.sw_if_index_from = m_itf_from.
value();
91 payload.sw_if_index_to = m_itf_to.
value();
105 std::ostringstream s;
107 <<
" itf-from:" << m_itf_from.
to_string()
126 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
128 auto& payload = m_dump->get_request().get_payload();
141 return (
"interface-span-dump");
static const rc_t NOOP
The HW write/update action was/has not been attempted.
int value() const
Return the value of the enum - same as integer conversion.
uint32_t value() const
get the value of the handle
std::string to_string() const
convert to string format for debug purposes
bool operator==(const config_cmd &i) const
Comparison operator - only used for UT.
Error codes that VPP will return during a HW write.
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
std::string to_string() const
convert to string format for debug purposes
rc_t wait()
Wait on the commands promise.
A command class that configures the interface span.
std::string to_string() const
convert to string format for debug purposes
A cmd class that Unconfigs interface span.
vhost_vring_state_t state
A representation of the connection to VPP.
std::string to_string() const
convert to string format for debug purposes
config_cmd(HW::item< bool > &item, const handle_t &itf_from, const handle_t &itf_to, const interface_span::state_t &state)
Constructor.
A base class for all RPC commands to VPP.
A cmd class that Dumps all the interface spans.
#define VAPI_CALL(_stmt)
Convenince wrapper macro for error handling in VAPI sends.
unconfig_cmd(HW::item< bool > &item, const handle_t &itf_from, const handle_t &itf_to)
Constructor.
std::string to_string() const
convert to string format for debug purposes
A type declaration of an interface handle in VPP.
rc_t issue(connection &con)
Issue the command to VPP/HW.
bool operator==(const unconfig_cmd &i) const
Comparison operator - only used for UT.
static const rc_t OK
The HW write was successfull.
rc_t issue(connection &con)
Issue the command to VPP/HW.
rc_t issue(connection &con)
Issue the command to VPP/HW.
vapi::Connection & ctx()
Retrun the VAPI context the commands will use.
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.
const std::string & to_string() const
convert to string format for debug purposes
HW::item< bool > & m_hw_item
A reference to an object's HW::item that the command will update.
The state of the interface - rx/tx or both to be mirrored.
HW::item< bool > & item()
return the HW item the command updates
vapi::Sw_interface_span_enable_disable msg_t
convenient typedef
DEFINE_VAPI_MSG_IDS_SPAN_API_JSON