29 , m_instance(instance)
41 auto& payload = reply.get_response().get_payload();
48 static_cast<handle_t>(payload.pipe_sw_if_index[0]),
49 static_cast<handle_t>(payload.pipe_sw_if_index[1])),
59 msg_t req(con.
ctx(), std::ref(*
this));
61 auto& payload = req.get_request().get_payload();
63 payload.is_specified = 1;
64 payload.user_instance = m_instance;
80 s <<
"pipe-create: " <<
m_name <<
" instance:" << m_instance;
88 , m_hdl_pair(end_pair)
100 msg_t req(con.
ctx(), std::ref(*
this));
116 return (
"pipe-delete");
128 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
140 return (
"pipe-dump");
static const rc_t NOOP
The HW write/update action was/has not been attempted.
static const rc_t & from_vpp_retval(int32_t rv)
Get the rc_t from the VPP API value.
A cmd class that Delete an interface.
DEFINE_VAPI_MSG_IDS_PIPE_API_JSON
void remove_interface()
remove the deleted interface from the DB
Error codes that VPP will return during a HW write.
static const log_level_t DEBUG
virtual vapi_error_e operator()(vapi::Pipe_create &reply)
call operator used as a callback by VAPI when the reply is available
rc_t wait()
Wait on the commands promise.
A functor class that creates an interface.
bool operator==(const delete_cmd &i) const
Comparison operator - only used for UT.
delete_cmd(HW::item< handle_t > &item, HW::item< pipe::handle_pair_t > &end_pair)
Constructor.
const std::string & m_name
The name of the interface to be created.
A representation of the connection to VPP.
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
#define VAPI_CALL(_stmt)
Convenince wrapper macro for error handling in VAPI sends.
rc_t issue(connection &con)
Issue the command to VPP/HW.
void fulfill(const HW::item< handle_t > &d)
Fulfill the commands promise.
std::string to_string() const
convert to string format for debug purposes
A representation of an interface in VPP.
A cmd class that Dumps all the Vpp interfaces.
static const rc_t OK
The HW write was successfull.
std::pair< handle_t, handle_t > handle_pair_t
vapi::Connection & ctx()
Retrun the VAPI context the commands will use.
bool operator==(const create_cmd &i) const
Comparison operator - only used for UT.
void insert_interface()
add the created interface to the DB
The VPP Object Model (VOM) library.
create_cmd(HW::item< handle_t > &item, const std::string &name, uint32_t instance, HW::item< pipe::handle_pair_t > &ends)
Cstrunctor taking the reference to the parent and the sub-interface's VLAN.
void set(const rc_t &rc)
Set the HW return code - should only be called from the family of Command objects.
std::string to_string() const
convert to string format for debug purposes
rc_t issue(connection &con)
Issue the command to VPP/HW.
std::string to_string() const
convert to string format for debug purposes
HW::item< handle_t > & m_hw_item
A reference to an object's HW::item that the command will update.
HW::item< handle_t > & item()
return the HW item the command updates
vapi::Pipe_create msg_t
convenient typedef
rc_t issue(connection &con)
Issue the command to VPP/HW.