FD.io VPP
v19.04-6-g6f05f72
Vector Packet Processing
|
A base class for all RPC commands to VPP. More...
Public Types | |
typedef MSG | msg_t |
convenient typedef More... | |
Public Member Functions | |
rpc_cmd (HWITEM &item) | |
Constructor taking the HW item that will be updated by the command. More... | |
virtual | ~rpc_cmd () |
Desructor. More... | |
HWITEM & | item () |
return the HW item the command updates More... | |
const HWITEM & | item () const |
return the const HW item the command updates More... | |
void | fulfill (const HWITEM &d) |
Fulfill the commands promise. More... | |
rc_t | wait () |
Wait on the commands promise. More... | |
virtual void | succeeded () |
Called by the HW Command Q when it is disabled to indicate the command can be considered successful without issuing it to HW. More... | |
virtual vapi_error_e | operator() (MSG &reply) |
call operator used as a callback by VAPI when the reply is available More... | |
virtual void | retire (connection &con) |
Retire/cancel a long running command. More... | |
Public Member Functions inherited from VOM::cmd | |
cmd () | |
Default constructor. More... | |
virtual | ~cmd () |
Virtual destructor. More... | |
virtual rc_t | issue (connection &con)=0 |
Issue the command to VPP/HW. More... | |
virtual std::string | to_string () const =0 |
convert to string format for debug purposes More... | |
Protected Attributes | |
HWITEM & | m_hw_item |
A reference to an object's HW::item that the command will update. More... | |
std::promise< HWITEM > | m_promise |
The promise that implements the synchronous issue. More... | |
A base class for all RPC commands to VPP.
RPC commands are one of the sub-set of command types to VPP that modify/create state in VPP and thus return an error code. Commands are issued in one thread context, but read in another. The command has an associated std::promise that is met by the RX thread. this allows the sender, which waits on the promise's future, to experience a synchronous command.
The command is templatised on the type of the HW::item to be set by the command, and the data returned in the promise,
Definition at line 40 of file rpc_cmd.hpp.
typedef MSG VOM::rpc_cmd< HWITEM, MSG >::msg_t |
convenient typedef
Definition at line 46 of file rpc_cmd.hpp.
|
inline |
Constructor taking the HW item that will be updated by the command.
Definition at line 51 of file rpc_cmd.hpp.
|
inlinevirtual |
Desructor.
Definition at line 61 of file rpc_cmd.hpp.
|
inline |
Fulfill the commands promise.
Called from the RX thread
Definition at line 76 of file rpc_cmd.hpp.
|
inline |
return the HW item the command updates
Definition at line 66 of file rpc_cmd.hpp.
|
inline |
return the const HW item the command updates
Definition at line 71 of file rpc_cmd.hpp.
|
inlinevirtual |
call operator used as a callback by VAPI when the reply is available
Reimplemented in VOM::interface::create_cmd< MSG >, VOM::interface::create_cmd< vapi::Vxlan_gbp_tunnel_add_del >, VOM::interface::create_cmd< vapi::Create_vhost_user_if >, VOM::interface::create_cmd< vapi::Af_packet_create >, VOM::interface::create_cmd< vapi::Bond_create >, VOM::interface::create_cmd< vapi::Vxlan_add_del_tunnel >, VOM::interface::create_cmd< vapi::Pipe_create >, VOM::interface::create_cmd< vapi::Gbp_vxlan_tunnel_add >, VOM::interface::create_cmd< vapi::Create_loopback >, VOM::interface::create_cmd< vapi::Bvi_create >, VOM::interface::create_cmd< vapi::Create_vlan_subif >, VOM::interface::create_cmd< vapi::Tap_create_v2 >, VOM::ACL::list_cmds::update_cmd< LIST, UPDATE >, VOM::pipe_cmds::create_cmd, and VOM::gbp_endpoint_cmds::create_cmd.
Definition at line 112 of file rpc_cmd.hpp.
|
inlinevirtual |
Retire/cancel a long running command.
Implements VOM::cmd.
Reimplemented in VOM::interface_cmds::events_cmd, VOM::dhcp_client_cmds::events_cmd, VOM::event_cmd< WANT, EVENT >, VOM::event_cmd< vapi::Control_ping, vapi::Dhcp_compl_event >, and VOM::event_cmd< vapi::Want_interface_events, vapi::Sw_interface_event >.
Definition at line 128 of file rpc_cmd.hpp.
|
inlinevirtual |
Called by the HW Command Q when it is disabled to indicate the command can be considered successful without issuing it to HW.
Implements VOM::cmd.
Reimplemented in VOM::interface::delete_cmd< MSG >, VOM::interface::delete_cmd< vapi::Vxlan_gbp_tunnel_add_del >, VOM::interface::delete_cmd< vapi::Bvi_delete >, VOM::interface::delete_cmd< vapi::Af_packet_delete >, VOM::interface::delete_cmd< vapi::Bond_delete >, VOM::interface::delete_cmd< vapi::Pipe_delete >, VOM::interface::delete_cmd< vapi::Vxlan_add_del_tunnel >, VOM::interface::delete_cmd< vapi::Delete_subif >, VOM::interface::delete_cmd< vapi::Gbp_vxlan_tunnel_del >, VOM::interface::delete_cmd< vapi::Delete_vhost_user_if >, VOM::interface::delete_cmd< vapi::Tap_delete_v2 >, VOM::interface::delete_cmd< vapi::Delete_loopback >, VOM::interface::create_cmd< MSG >, VOM::interface::create_cmd< vapi::Vxlan_gbp_tunnel_add_del >, VOM::interface::create_cmd< vapi::Create_vhost_user_if >, VOM::interface::create_cmd< vapi::Af_packet_create >, VOM::interface::create_cmd< vapi::Bond_create >, VOM::interface::create_cmd< vapi::Vxlan_add_del_tunnel >, VOM::interface::create_cmd< vapi::Pipe_create >, VOM::interface::create_cmd< vapi::Gbp_vxlan_tunnel_add >, VOM::interface::create_cmd< vapi::Create_loopback >, VOM::interface::create_cmd< vapi::Bvi_create >, VOM::interface::create_cmd< vapi::Create_vlan_subif >, VOM::interface::create_cmd< vapi::Tap_create_v2 >, and VOM::ACL::list_cmds::update_cmd< LIST, UPDATE >.
Definition at line 103 of file rpc_cmd.hpp.
|
inline |
Wait on the commands promise.
i.e. block on the completion of the command.
Definition at line 82 of file rpc_cmd.hpp.
|
protected |
A reference to an object's HW::item that the command will update.
Definition at line 134 of file rpc_cmd.hpp.
|
protected |
The promise that implements the synchronous issue.
Definition at line 139 of file rpc_cmd.hpp.