21 namespace interface_span_cmds {
28 , m_itf_from(itf_from)
36 return ((m_itf_from == o.m_itf_from) && (m_itf_to == o.m_itf_to) &&
37 (m_state == o.m_state));
43 msg_t req(con.
ctx(), std::ref(*
this));
45 auto& payload = req.get_request().get_payload();
47 payload.sw_if_index_from = m_itf_from.
value();
48 payload.sw_if_index_to = m_itf_to.
value();
49 payload.state = (vapi_enum_span_state)m_state.
value();
71 , m_itf_from(itf_from)
78 return ((m_itf_from == o.m_itf_from) && (m_itf_to == o.m_itf_to));
84 msg_t req(con.
ctx(), std::ref(*
this));
86 auto& payload = req.get_request().get_payload();
88 payload.sw_if_index_from = m_itf_from.
value();
89 payload.sw_if_index_to = m_itf_to.
value();
103 std::ostringstream s;
105 <<
" itf-from:" << m_itf_from.
to_string()
122 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
124 auto& payload = m_dump->get_request().get_payload();
137 return (
"interface-span-dump");
static const rc_t NOOP
The HW write/update action was/has not been attempted.
uint32_t value() const
get the value of the handle
Error codes that VPP will return during a HW write.
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
int value() const
Return the value of the enum - same as integer conversion.
rc_t wait()
Wait on the commands promise.
std::string to_string() const
convert to string format for debug purposes
A command class that configures the interface span.
A cmd class that Unconfigs interface span.
bool operator==(const config_cmd &i) const
Comparison operator - only used for UT.
A representation of the connection to VPP.
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.
const std::string & to_string() const
convert to string format for debug purposes
static const rc_t OK
The HW write was successfull.
std::string to_string() const
convert to string format for debug purposes
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.
vl_api_dhcp_client_state_t state
std::string to_string() const
convert to string format for debug purposes
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.
bool operator==(const unconfig_cmd &i) const
Comparison operator - only used for UT.
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