19 namespace l2_binding_cmds {
27 , m_port_type(port_type)
34 return ((m_itf == other.m_itf) && (m_bd == other.m_bd) &&
35 (m_port_type == other.m_port_type));
41 msg_t req(con.
ctx(), std::ref(*
this));
43 auto& payload = req.get_request().get_payload();
44 payload.rx_sw_if_index = m_itf.
value();
66 <<
" bd:" << m_bd <<
" port-type:" << m_port_type.
to_string();
78 , m_port_type(port_type)
85 return ((m_itf == other.m_itf) && (m_bd == other.m_bd) &&
86 (m_port_type == other.m_port_type));
92 msg_t req(con.
ctx(), std::ref(*
this));
94 auto& payload = req.get_request().get_payload();
95 payload.rx_sw_if_index = m_itf.
value();
118 std::ostringstream s;
120 <<
" bd:" << m_bd <<
" port-type:" << m_port_type;
static const rc_t NOOP
The HW write/update action was/has not been attempted.
std::string to_string() const
convert to string format for debug purposes
uint32_t value() const
get the value of the handle
Error codes that VPP will return during a HW write.
std::string to_string() const
convert to string format for debug purposes
rc_t wait()
Wait on the commands promise.
std::string to_string() const
convert to string format for debug purposes
A functor class that binds L2 configuration to an interface.
rc_t issue(connection &con)
Issue the command to VPP/HW.
A representation of the connection to VPP.
A base class for all RPC commands to VPP.
unbind_cmd(HW::item< bool > &item, const handle_t &itf, uint32_t bd, const l2_binding::l2_port_type_t &port_type)
Constructor.
static const l2_port_type_t L2_PORT_TYPE_UU_FWD
#define VAPI_CALL(_stmt)
Convenince wrapper macro for error handling in VAPI sends.
A type declaration of an interface handle in VPP.
static const l2_port_type_t L2_PORT_TYPE_BVI
bool operator==(const unbind_cmd &i) const
Comparison operator - only used for UT.
A cmd class that Unbinds L2 configuration from an interface.
static const rc_t OK
The HW write was successfull.
bool operator==(const bind_cmd &i) const
Comparison operator - only used for UT.
vapi::Connection & ctx()
Retrun the VAPI context the commands will use.
bind_cmd(HW::item< bool > &item, const handle_t &itf, uint32_t bd, const l2_binding::l2_port_type_t &port_type)
Constructor.
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
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.
HW::item< bool > & item()
return the HW item the command updates
vapi::Sw_interface_set_l2_bridge msg_t
convenient typedef
rc_t issue(connection &con)
Issue the command to VPP/HW.