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;
60 <<
" src-epg-id:" << m_src_epg_id <<
" dst-epg-id:" << m_dst_epg_id
70 , m_src_epg_id(src_epg_id)
71 , m_dst_epg_id(dst_epg_id)
78 return ((m_src_epg_id == other.m_src_epg_id) &&
79 (m_dst_epg_id == other.m_dst_epg_id));
85 msg_t req(con.
ctx(), std::ref(*
this));
87 auto& payload = req.get_request().get_payload();
89 payload.contract.acl_index = ~0;
90 payload.contract.src_epg = m_src_epg_id;
91 payload.contract.dst_epg = m_dst_epg_id;
101 std::ostringstream s;
103 <<
" src-epg-id:" << m_src_epg_id <<
" dst-epg-id:" << m_dst_epg_id;
117 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
129 return (
"gbp-contract-dump");
std::string to_string() const
convert to string format for debug purposes
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
rc_t wait()
Wait on the commands promise.
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
A representation of the connection to VPP.
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
A cmd class that deletes a GBP contract.
HW::item< bool > & m_hw_item
A reference to an object's HW::item that the command will update.
HW::item< bool > & item()
return the HW item the command updates
vapi::Gbp_contract_add_del msg_t
convenient typedef