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;
139 (m_tag == other.m_tag));
145 msg_t req(con.
ctx(), std::ref(*
this));
147 auto& payload = req.get_request().get_payload();
148 payload.sw_if_index = m_itf.
value();
150 payload.push_dot1q = 1;
151 payload.tag1 = m_tag;
161 std::ostringstream s;
163 <<
" itf:" << m_itf.
to_string() <<
" tag:" << m_tag;
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.
int value() const
Return the value of the enum - same as integer conversion.
rc_t wait()
Wait on the commands promise.
T & data()
Return the data read/written.
std::string to_string() const
convert to string format for debug purposes
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.
std::string to_string() const
convert to string format for debug purposes
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.
rc_t issue(connection &con)
Issue the command to VPP/HW.
std::string to_string() const
convert to string format for debug purposes
std::string to_string() const
convert to string format for debug purposes
A type declaration of an interface handle in VPP.
const std::string & to_string() const
convert to string format for debug purposes
static const l2_port_type_t L2_PORT_TYPE_BVI
A cmd class that Unbinds L2 configuration from an interface.
static const rc_t OK
The HW write was successfull.
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.
bool operator==(const unbind_cmd &i) const
Comparison operator - only used for UT.
set_vtr_op_cmd(HW::item< l2_binding::l2_vtr_op_t > &item, const handle_t &itf, uint16_t tag)
Constructor.
A cmd class sets the VTR operation.
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
bool operator==(const set_vtr_op_cmd &i) const
Comparison operator - only used for UT.
rc_t issue(connection &con)
Issue the command to VPP/HW.
bool operator==(const bind_cmd &i) const
Comparison operator - only used for UT.