24 const std::string&
name,
29 , m_instance(instance)
42 auto& payload = reply.get_response().get_payload();
49 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)
101 msg_t req(con.
ctx(), std::ref(*
this));
117 return (
"pipe-delete");
129 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
141 return (
"pipe-dump");
static const rc_t NOOP
The HW write/update action was/has not been attempted.
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
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
std::string to_string() const
convert to string format for debug purposes
rc_t wait()
Wait on the commands promise.
A functor class that creates an interface.
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.
#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.
bool operator==(const create_cmd &i) const
Comparison operator - only used for UT.
std::string to_string() const
convert to string format for debug purposes
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
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.
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.
rc_t issue(connection &con)
Issue the command to VPP/HW.
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.