19 namespace gbp_contract_cmds {
26 , m_src_epg_id(src_epg_id)
27 , m_dst_epg_id(dst_epg_id)
35 return ((m_acl == other.m_acl) && (m_src_epg_id == other.m_src_epg_id) &&
36 (m_dst_epg_id == other.m_dst_epg_id));
42 msg_t req(con.
ctx(), std::ref(*
this));
44 auto& payload = req.get_request().get_payload();
46 payload.contract.acl_index = m_acl.
value();
47 payload.contract.src_epg = m_src_epg_id;
48 payload.contract.dst_epg = m_dst_epg_id;
62 <<
" src-epg-id:" << m_src_epg_id <<
" dst-epg-id:" << m_dst_epg_id
72 , m_src_epg_id(src_epg_id)
73 , m_dst_epg_id(dst_epg_id)
80 return ((m_src_epg_id == other.m_src_epg_id) &&
81 (m_dst_epg_id == other.m_dst_epg_id));
87 msg_t req(con.
ctx(), std::ref(*
this));
89 auto& payload = req.get_request().get_payload();
91 payload.contract.acl_index = ~0;
92 payload.contract.src_epg = m_src_epg_id;
93 payload.contract.dst_epg = m_dst_epg_id;
105 std::ostringstream s;
107 <<
" src-epg-id:" << m_src_epg_id <<
" dst-epg-id:" << m_dst_epg_id;
121 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
133 return (
"gbp-contract-dump");
std::string to_string() const
convert to string format for debug purposes
HW::item< bool > & m_hw_item
A reference to an object's HW::item that the command will update.
uint32_t value() const
get the value of the handle
uint32_t epg_id_t
EPG IDs are 32 bit integers.
rc_t issue(connection &con)
Issue the command to VPP/HW.
rc_t issue(connection &con)
Issue the command to VPP/HW.
A cmd class that Dumps all the GBP endpoints.
Error codes that VPP will return during a HW write.
std::string to_string() const
convert to string format for debug purposes
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
A representation of the connection to VPP.
HW::item< bool > & item()
return the HW item the command updates
std::string to_string() const
convert to string format for debug purposes
A base class for all RPC commands to VPP.
#define VAPI_CALL(_stmt)
Convenince wrapper macro for error handling in VAPI sends.
bool operator==(const create_cmd &i) const
Comparison operator - only used for UT.
delete_cmd(HW::item< bool > &item, epg_id_t src_epg_id, epg_id_t dst_epg_id)
Constructor.
rc_t issue(connection &con)
Issue the command to VPP/HW.
A type declaration of an interface handle in VPP.
A command class that creates or updates the GBP contract.
static const rc_t OK
The HW write was successfull.
bool operator==(const delete_cmd &i) const
Comparison operator - only used for UT.
create_cmd(HW::item< bool > &item, epg_id_t src_epg_id, epg_id_t dst_epg_id, const handle_t &acl)
Constructor.
vapi::Connection & ctx()
Retrun the VAPI context the commands will use.
The VPP Object Model (VOM) library.
std::string to_string() const
convert to string format for debug purposes
void set(const rc_t &rc)
Set the HW return code - should only be called from the family of Command objects.
vapi::Gbp_contract_add_del msg_t
convenient typedef
A cmd class that deletes a GBP contract.
rc_t wait()
Wait on the commands promise.