19 #include <vapi/vpe.api.vapi.hpp> 22 namespace sub_interface_cmds {
25 const std::string& name,
37 return ((
m_name == other.
m_name) && (m_parent == other.m_parent) &&
38 (m_vlan == other.m_vlan));
44 msg_t req(con.
ctx(), std::ref(*
this));
46 auto& payload = req.get_request().get_payload();
47 payload.sw_if_index = m_parent.
value();
48 payload.vlan_id = m_vlan;
66 <<
" vlan:" << m_vlan;
84 msg_t req(con.
ctx(), std::ref(*
this));
86 auto& payload = req.get_request().get_payload();
101 std::ostringstream s;
static const rc_t NOOP
The HW write/update action was/has not been attempted.
HW::item< handle_t > & m_hw_item
A reference to an object's HW::item that the command will update.
bool operator==(const create_cmd &i) const
Comparison operator - only used for UT.
void remove_interface()
add the created interface to the DB
uint32_t value() const
get the value of the handle
delete_cmd(HW::item< handle_t > &item)
Constructor.
Error codes that VPP will return during a HW write.
std::string to_string() const
convert to string format for debug purposes
T & data()
Return the data read/written.
rc_t issue(connection &con)
Issue the command to VPP/HW.
create_cmd(HW::item< handle_t > &item, const std::string &name, const handle_t &parent, uint16_t vlan)
Cstrunctor taking the reference to the parent and the sub-interface's VLAN.
std::string to_string() const
convert to string format for debug purposes
const std::string & m_name
The name of the interface to be created.
A representation of the connection to VPP.
rc_t issue(connection &con)
Issue the command to VPP/HW.
A functor class that creates an interface.
HW::item< handle_t > & item()
return the HW item the command updates
#define VAPI_CALL(_stmt)
Convenince wrapper macro for error handling in VAPI sends.
A cmd class that Delete an interface.
A representation of an interface in VPP.
A type declaration of an interface handle in VPP.
static const rc_t OK
The HW write was successfull.
vapi::Connection & ctx()
Retrun the VAPI context the commands will use.
void insert_interface()
add the created interface to the DB
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.
vapi::Create_vlan_subif msg_t
convenient typedef
bool operator==(const delete_cmd &i) const
Comparison operator - only used for UT.
std::string to_string() const
convert to string format for debug purposes
HW::item< handle_t > wait()
Wait on the commands promise.